Bug 1472973 part 4 - Use JS::GetNonCCWObjectGlobal in PrefableDisablers::isEnabled. r=bz

This commit is contained in:
Jan de Mooij 2018-07-06 18:16:23 +02:00
parent 09149a5c4a
commit 81ec9d746f

View File

@ -121,7 +121,7 @@ struct PrefableDisablers {
// globals; our IDL parser enforces that. So as long as we check our
// exposure set before checking "enabled" we will be ok.
if (nonExposedGlobals &&
IsNonExposedGlobal(cx, js::GetGlobalForObjectCrossCompartment(obj),
IsNonExposedGlobal(cx, JS::GetNonCCWObjectGlobal(obj),
nonExposedGlobals)) {
return false;
}
@ -131,8 +131,7 @@ struct PrefableDisablers {
if (secureContext && !IsSecureContextOrObjectIsFromSecureContext(cx, obj)) {
return false;
}
if (enabledFunc &&
!enabledFunc(cx, js::GetGlobalForObjectCrossCompartment(obj))) {
if (enabledFunc && !enabledFunc(cx, JS::GetNonCCWObjectGlobal(obj))) {
return false;
}
return true;