From f28f2573f7dde64e14393caab705737b9ab92844 Mon Sep 17 00:00:00 2001 From: Blake Kaplan Date: Tue, 8 Mar 2011 15:04:59 -0800 Subject: [PATCH] Bug 638026 - Make sure we hold onto the right JS object here. r=jst --HG-- extra : rebase_source : 5ebebc39f689d0b76e51b2ca79fa432871b1404e --- js/src/xpconnect/src/xpcvariant.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/src/xpconnect/src/xpcvariant.cpp b/js/src/xpconnect/src/xpcvariant.cpp index e7edd8df0796..aec9b91810d8 100644 --- a/js/src/xpconnect/src/xpcvariant.cpp +++ b/js/src/xpconnect/src/xpcvariant.cpp @@ -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.