From 0ac4a08fc8f604df3e472135b20c1e7bf4c39863 Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Sat, 16 Mar 2013 22:58:13 -0700 Subject: [PATCH] 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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp index 0568749e279..f6f4d6d3093 100644 --- a/js/xpconnect/src/XPCWrappedNativeJSOps.cpp +++ b/js/xpconnect/src/XPCWrappedNativeJSOps.cpp @@ -1441,7 +1441,7 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp) 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); @@ -1451,7 +1451,6 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp) 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);