mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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).
This commit is contained in:
parent
3e05c5d01b
commit
0ac4a08fc8
@ -1441,7 +1441,7 @@ XPC_WN_GetterSetter(JSContext *cx, unsigned argc, jsval *vp)
|
|||||||
if (IS_SLIM_WRAPPER(obj) && !MorphSlimWrapper(cx, obj))
|
if (IS_SLIM_WRAPPER(obj) && !MorphSlimWrapper(cx, obj))
|
||||||
return Throw(NS_ERROR_XPC_BAD_OP_ON_WN_PROTO, cx);
|
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();
|
XPCWrappedNative* wrapper = ccx.GetWrapper();
|
||||||
THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
|
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))
|
if (!XPCNativeMember::GetCallInfo(funobj, &iface, &member))
|
||||||
return Throw(NS_ERROR_XPC_CANT_GET_METHOD_INFO, cx);
|
return Throw(NS_ERROR_XPC_CANT_GET_METHOD_INFO, cx);
|
||||||
|
|
||||||
ccx.SetArgsAndResultPtr(argc, JS_ARGV(cx, vp), vp);
|
|
||||||
if (argc && member->IsWritableAttribute()) {
|
if (argc && member->IsWritableAttribute()) {
|
||||||
ccx.SetCallInfo(iface, member, true);
|
ccx.SetCallInfo(iface, member, true);
|
||||||
JSBool retval = XPCWrappedNative::SetAttribute(ccx);
|
JSBool retval = XPCWrappedNative::SetAttribute(ccx);
|
||||||
|
Loading…
Reference in New Issue
Block a user