mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-02 18:08:58 +00:00
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:
parent
f888b4bd3d
commit
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;
|
||||
|
Loading…
Reference in New Issue
Block a user