mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1090749. Reverse the isSelfHosted test in XrayWrapper and jsapi.cpp. r=waldo
This commit is contained in:
parent
3cc3a6789e
commit
98fc026551
@ -3317,13 +3317,7 @@ JS_DefineProperties(JSContext *cx, HandleObject obj, const JSPropertySpec *ps)
|
||||
if (!PropertySpecNameToId(cx, ps->name, &id))
|
||||
return false;
|
||||
|
||||
if (!ps->isSelfHosted()) {
|
||||
if (!DefinePropertyById(cx, obj, id, JS::UndefinedHandleValue,
|
||||
ps->getter.native, ps->setter.native, ps->flags, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (ps->isSelfHosted()) {
|
||||
if (!DefineSelfHostedProperty(cx, obj, id,
|
||||
ps->getter.selfHosted.funname,
|
||||
ps->setter.selfHosted.funname,
|
||||
@ -3331,6 +3325,12 @@ JS_DefineProperties(JSContext *cx, HandleObject obj, const JSPropertySpec *ps)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (!DefinePropertyById(cx, obj, id, JS::UndefinedHandleValue,
|
||||
ps->getter.native, ps->setter.native, ps->flags, 0))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -504,12 +504,7 @@ JSXrayTraits::resolveOwnProperty(JSContext *cx, const Wrapper &jsWrapper,
|
||||
RootedFunction getterObj(cx);
|
||||
RootedFunction setterObj(cx);
|
||||
unsigned flags = psMatch->flags;
|
||||
if (!psMatch->isSelfHosted()) {
|
||||
desc.setGetter(JS_CAST_NATIVE_TO(psMatch->getter.native.op,
|
||||
JSPropertyOp));
|
||||
desc.setSetter(JS_CAST_NATIVE_TO(psMatch->setter.native.op,
|
||||
JSStrictPropertyOp));
|
||||
} else {
|
||||
if (psMatch->isSelfHosted()) {
|
||||
getterObj = JS::GetSelfHostedFunction(cx, psMatch->getter.selfHosted.funname, id, 0);
|
||||
if (!getterObj)
|
||||
return false;
|
||||
@ -521,6 +516,11 @@ JSXrayTraits::resolveOwnProperty(JSContext *cx, const Wrapper &jsWrapper,
|
||||
return false;
|
||||
desc.setSetterObject(JS_GetFunctionObject(setterObj));
|
||||
}
|
||||
} else {
|
||||
desc.setGetter(JS_CAST_NATIVE_TO(psMatch->getter.native.op,
|
||||
JSPropertyOp));
|
||||
desc.setSetter(JS_CAST_NATIVE_TO(psMatch->setter.native.op,
|
||||
JSStrictPropertyOp));
|
||||
}
|
||||
desc.setAttributes(flags);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user