Closed Bug 413783 Opened 18 years ago Closed 18 years ago

Params are not cleared for every call but instead are appended

Categories

(Core :: js-ctypes, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: om.brahmana, Assigned: om.brahmana)

Details

Attachments

(1 file)

nsNativeMethod::Call() the parameter values are continuously appended which results in same behavior for multiple calls with different values.
Attached patch patch v0.1 — — Splinter Review
Made the changes and it works absolutely fine for me. (On Windows)
Attachment #298863 - Flags: review?(mark.finkle)
Comment on attachment 298863 [details] [diff] [review] patch v0.1 >Index: nsNativeMethod.cpp >-NS_IMETHODIMP nsNativeMethod::Execute(JSContext* aContext, jsval* aValue) >+NS_IMETHODIMP nsNativeMethod::Execute(JSContext* aContext, jsval* aValue, nsCOMArray<nsIVariant> aValues) use nsCOMArray<nsIVariant> &aValues so we don't copy the array > >+ nsCOMArray<nsIVariant> paramValues; > for (PRUint32 i=0; i<argc; i++) { > nsCOMPtr<nsIVariant> varValue; > GET_ARG(varValue, argv[i]); >- mValues.AppendObject(varValue); >+ paramValues.AppendObject(varValue); > } > > #undef GET_ARG > >- rv = Execute(cx, vp); >+ rv = Execute(cx, vp, paramValues); > > *_retval = PR_TRUE; > paramValues -> values >Index: nsNativeMethod.h >- NS_IMETHOD Execute(JSContext* aContext, jsval* aValue); >+ NS_IMETHOD Execute(JSContext* aContext, jsval* aValue, nsCOMArray<nsIVariant> aValues); use here too: nsCOMArray<nsIVariant> &aValues good job. r=mfinkle I can land this.
Attachment #298863 - Flags: review?(mark.finkle) → review+
landed
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Product: Other Applications → Core
Version: Trunk → unspecified
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: