зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1525673. Don't assume that same-compartment means same-realm in WrapNewBindingNonWrapperCache. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D18863 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
f888b4bd3d
Коммит
afcd9842ec
|
@ -1171,8 +1171,14 @@ inline bool WrapNewBindingNonWrapperCachedObject(
|
|||
if (!JS_WrapObject(cx, &proto)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// cx and scope are same-compartment, but they might still be
|
||||
// different-Realm. Enter the Realm of scope, since that's
|
||||
// where we want to create our object.
|
||||
ar.emplace(cx, scope);
|
||||
}
|
||||
|
||||
MOZ_ASSERT_IF(proto, js::IsObjectInContextCompartment(proto, cx));
|
||||
MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx));
|
||||
if (!value->WrapObject(cx, proto, &obj)) {
|
||||
return false;
|
||||
|
@ -1223,8 +1229,14 @@ inline bool WrapNewBindingNonWrapperCachedObject(
|
|||
if (!JS_WrapObject(cx, &proto)) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
// cx and scope are same-compartment, but they might still be
|
||||
// different-Realm. Enter the Realm of scope, since that's
|
||||
// where we want to create our object.
|
||||
ar.emplace(cx, scope);
|
||||
}
|
||||
|
||||
MOZ_ASSERT_IF(proto, js::IsObjectInContextCompartment(proto, cx));
|
||||
MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx));
|
||||
if (!value->WrapObject(cx, proto, &obj)) {
|
||||
return false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче