mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 828494 - Part a: Pass MutableHandleValue to GetOwnPropertyDescriptor; r=terrence
This commit is contained in:
parent
8f1392bb58
commit
01f1ef559a
@ -736,13 +736,14 @@ obj_create(JSContext *cx, unsigned argc, Value *vp)
|
||||
static JSBool
|
||||
obj_getOwnPropertyDescriptor(JSContext *cx, unsigned argc, Value *vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
RootedObject obj(cx);
|
||||
if (!GetFirstArgumentAsObject(cx, argc, vp, "Object.getOwnPropertyDescriptor", &obj))
|
||||
return JS_FALSE;
|
||||
RootedId id(cx);
|
||||
if (!ValueToId(cx, argc >= 2 ? vp[3] : UndefinedValue(), &id))
|
||||
if (!ValueToId(cx, args.length() > 1 ? args[1] : UndefinedValue(), &id))
|
||||
return JS_FALSE;
|
||||
return GetOwnPropertyDescriptor(cx, obj, id, vp);
|
||||
return GetOwnPropertyDescriptor(cx, obj, id, args.rval());
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
@ -4162,7 +4162,11 @@ JS_GetOwnPropertyDescriptor(JSContext *cx, JSObject *objArg, jsid idArg, jsval *
|
||||
AssertHeapIsIdle(cx);
|
||||
CHECK_REQUEST(cx);
|
||||
|
||||
return GetOwnPropertyDescriptor(cx, obj, id, vp);
|
||||
RootedValue value(cx);
|
||||
if (!GetOwnPropertyDescriptor(cx, obj, id, &value))
|
||||
return false;
|
||||
*vp = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
|
@ -293,11 +293,11 @@ js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id,
|
||||
}
|
||||
|
||||
bool
|
||||
js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, Value *vp)
|
||||
js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp)
|
||||
{
|
||||
AutoPropertyDescriptorRooter desc(cx);
|
||||
return GetOwnPropertyDescriptor(cx, obj, id, &desc) &&
|
||||
NewPropertyDescriptorObject(cx, &desc, vp);
|
||||
NewPropertyDescriptorObject(cx, &desc, vp.address());
|
||||
}
|
||||
|
||||
bool
|
||||
|
@ -1312,7 +1312,7 @@ bool
|
||||
GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, PropertyDescriptor *desc);
|
||||
|
||||
bool
|
||||
GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, Value *vp);
|
||||
GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id, MutableHandleValue vp);
|
||||
|
||||
bool
|
||||
NewPropertyDescriptorObject(JSContext *cx, const PropertyDescriptor *desc, Value *vp);
|
||||
|
Loading…
Reference in New Issue
Block a user