зеркало из https://github.com/mozilla/gecko-dev.git
Bug 602223 - Use the global object instead of the parent so we're sure to have a non-null parent. r=gal a=blocking beta7
This commit is contained in:
Родитель
9d1fe775c9
Коммит
f14c5e0020
|
@ -295,6 +295,7 @@ JSObject *
|
|||
JSWrapper::New(JSContext *cx, JSObject *obj, JSObject *proto, JSObject *parent,
|
||||
JSWrapper *handler)
|
||||
{
|
||||
JS_ASSERT(parent);
|
||||
return NewProxyObject(cx, handler, ObjectValue(*obj), proto, parent,
|
||||
obj->isCallable() ? obj : NULL, NULL);
|
||||
}
|
||||
|
@ -345,6 +346,7 @@ AutoCompartment::enter()
|
|||
|
||||
context->compartment = destination;
|
||||
JSObject *scopeChain = target->getGlobal();
|
||||
JS_ASSERT(scopeChain->isNative());
|
||||
frame.construct();
|
||||
if (!context->stack().pushDummyFrame(context, *scopeChain, &frame.ref())) {
|
||||
frame.destroy();
|
||||
|
|
|
@ -71,7 +71,7 @@ DoubleWrap(JSContext *cx, JSObject *obj, uintN flags)
|
|||
{
|
||||
if (flags & WrapperFactory::WAIVE_XRAY_WRAPPER_FLAG) {
|
||||
js::SwitchToCompartment sc(cx, obj->compartment());
|
||||
return JSWrapper::New(cx, obj, NULL, obj->getParent(),
|
||||
return JSWrapper::New(cx, obj, NULL, obj->getGlobal(),
|
||||
&WaiveXrayWrapperWrapper);
|
||||
}
|
||||
return obj;
|
||||
|
@ -323,7 +323,7 @@ WrapperFactory::WaiveXrayAndWrap(JSContext *cx, jsval *vp)
|
|||
|
||||
{
|
||||
js::SwitchToCompartment sc(cx, obj->compartment());
|
||||
obj = JSWrapper::New(cx, obj, NULL, obj->getParent(), &WaiveXrayWrapperWrapper);
|
||||
obj = JSWrapper::New(cx, obj, NULL, obj->getGlobal(), &WaiveXrayWrapperWrapper);
|
||||
if (!obj)
|
||||
return false;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче