Bug 638026 - Make sure we hold onto the right JS object here. r=jst

--HG--
extra : rebase_source : 5ebebc39f689d0b76e51b2ca79fa432871b1404e
This commit is contained in:
Blake Kaplan 2011-03-08 15:04:59 -08:00
parent c54ec6b730
commit 5d28072106

View File

@ -63,6 +63,11 @@ XPCVariant::XPCVariant(XPCCallContext& ccx, jsval aJSVal)
nsVariant::Initialize(&mData);
if(!JSVAL_IS_PRIMITIVE(mJSVal))
{
JSObject *obj = JSVAL_TO_OBJECT(mJSVal);
OBJ_TO_INNER_OBJECT(ccx, obj);
mJSVal = OBJECT_TO_JSVAL(obj);
// If the incoming object is an XPCWrappedNative, then it could be a
// double-wrapped object, and we should return the double-wrapped
// object back out to script.