зеркало из https://github.com/mozilla/gecko-dev.git
Bug 787856 - Use static JSObject::getProto in proxy code; r=wmccloskey
This commit is contained in:
Родитель
ef2beecd2b
Коммит
dfa8197300
|
@ -1603,7 +1603,9 @@ ScriptedDirectProxyHandler::getPropertyDescriptor(JSContext *cx, JSObject *proxy
|
|||
return false;
|
||||
if (desc->obj)
|
||||
return true;
|
||||
JSObject *proto = proxy->getProto();
|
||||
RootedObject proto(cx);
|
||||
if (!JSObject::getProto(cx, proxy, &proto))
|
||||
return false;
|
||||
if (!proto) {
|
||||
JS_ASSERT(!desc->obj);
|
||||
return true;
|
||||
|
@ -3125,14 +3127,16 @@ proxy(JSContext *cx, unsigned argc, jsval *vp)
|
|||
"Proxy", "1", "s");
|
||||
return false;
|
||||
}
|
||||
JSObject *target = NonNullObject(cx, args[0]);
|
||||
RootedObject target(cx, NonNullObject(cx, args[0]));
|
||||
if (!target)
|
||||
return false;
|
||||
JSObject *handler = NonNullObject(cx, args[1]);
|
||||
RootedObject handler(cx, NonNullObject(cx, args[1]));
|
||||
if (!handler)
|
||||
return false;
|
||||
JSObject *proto = target->getProto();
|
||||
JSObject *fun = target->isCallable() ? target : NULL;
|
||||
RootedObject proto(cx);
|
||||
if (!JSObject::getProto(cx, target, &proto))
|
||||
return false;
|
||||
RootedObject fun(cx, target->isCallable() ? target : (JSObject *) NULL);
|
||||
JSObject *proxy = NewProxyObject(cx, &ScriptedDirectProxyHandler::singleton,
|
||||
ObjectValue(*target), proto, proto->getParent(),
|
||||
fun, fun);
|
||||
|
|
Загрузка…
Ссылка в новой задаче