зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1477989 part 2 - Use JS::GetNonCCWObjectGlobal in nsXBLBinding::DoInitJSClass. r=bz
This commit is contained in:
Родитель
b1f2f847f1
Коммит
99c47ba5c5
|
@ -958,7 +958,7 @@ nsXBLBinding::DoInitJSClass(JSContext *cx,
|
|||
// and defining it as a property on the XBL scope's global. This works fine,
|
||||
// but we need to make sure never to assume that the the reflector and
|
||||
// prototype are same-compartment with the bound document.
|
||||
JS::Rooted<JSObject*> global(cx, js::GetGlobalForObjectCrossCompartment(obj));
|
||||
JS::Rooted<JSObject*> global(cx, JS::GetNonCCWObjectGlobal(obj));
|
||||
|
||||
// We never store class objects in add-on scopes.
|
||||
JS::Rooted<JSObject*> xblScope(cx, xpc::GetXBLScopeOrGlobal(cx, global));
|
||||
|
|
|
@ -218,6 +218,10 @@ nsXBLProtoImpl::InitTargetObjects(nsXBLPrototypeBinding* aBinding,
|
|||
JS::Rooted<JSObject*> value(cx, &v.toObject());
|
||||
JSAutoRealm ar2(cx, value);
|
||||
|
||||
// We passed aAllowWrapping = false to nsContentUtils::WrapNative so we
|
||||
// should not have a wrapper.
|
||||
MOZ_ASSERT(!js::IsWrapper(value));
|
||||
|
||||
// All of the above code was just obtaining the bound element's script object and its immediate
|
||||
// concrete base class. We need to alter the object so that our concrete class is interposed
|
||||
// between the object and its base class. We become the new base class of the object, and the
|
||||
|
|
Загрузка…
Ссылка в новой задаче