Bug 658909 - Set args at XPCCallContext construct time in XPC_WN_GetterSetter. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Thu, 21 Mar 2013 08:20:42 -0700
changeset 125805 b20ec46f32c6da6a038f75b8d9558ede4b86333b
parent 125804 2b4be35b1837eaa59bbf7c2dedd535b89cb2c451
child 125806 ac4b41b1020d86c3ec92b94c5854619197ce87a0
push id24464
push useremorley@mozilla.com
push dateFri, 22 Mar 2013 14:00:12 +0000
treeherdermozilla-central@3825fdbcec62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs658909
milestone22.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 658909 - Set args at XPCCallContext construct time in XPC_WN_GetterSetter. r=mrbkap It's not clear to me why it's done this way, but it confuses our ability to determine during wrapper lookup whether we're doing a set or a get. This aligns the behavior with XPC_WN_CallMethod, including passing JSID_VOID for the name (which is safe because XPCCallContext explicitly special-cases JSID_VOID and doesn't call SetName in that case).
js/xpconnect/src/XPCWrappedNativeJSOps.cpp
--- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
+++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp
@@ -1436,27 +1436,26 @@ XPC_WN_GetterSetter(JSContext *cx, unsig
             funname = !funid ? "" : bytes.encodeLatin1(cx, funid) ? bytes.ptr() : "<error>";
         }
         SLIM_LOG_WILL_MORPH_FOR_PROP(cx, obj, funname);
     }
 #endif
     if (IS_SLIM_WRAPPER(obj) && !MorphSlimWrapper(cx, obj))
         return Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx);
 
-    XPCCallContext ccx(JS_CALLER, cx, obj, funobj);
+    XPCCallContext ccx(JS_CALLER, cx, obj, funobj, JSID_VOID, argc, JS_ARGV(cx, vp), vp);
     XPCWrappedNative* wrapper = ccx.GetWrapper();
     THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
 
     XPCNativeInterface* iface;
     XPCNativeMember*    member;
 
     if (!XPCNativeMember::GetCallInfo(funobj, &iface, &member))
         return Throw(NS_ERROR_XPC_CANT_GET_METHOD_INFO, cx);
 
-    ccx.SetArgsAndResultPtr(argc, JS_ARGV(cx, vp), vp);
     if (argc && member->IsWritableAttribute()) {
         ccx.SetCallInfo(iface, member, true);
         JSBool retval = XPCWrappedNative::SetAttribute(ccx);
         if (retval)
             *vp = JS_ARGV(cx, vp)[0];
         return retval;
     }
     // else...