Bug 1769322 - Allow for the possibility of non-xpc globals in nsIGlobal::IsScriptForbidden r=smaug

Differential Revision: https://phabricator.services.mozilla.com/D146347
This commit is contained in:
Matthew Gaudet
2022-05-24 17:23:32 +00:00
parent f15ef2f501
commit 75a6b094ed
4 changed files with 15 additions and 3 deletions

View File

@@ -976,7 +976,7 @@ bool ModuleLoaderBase::InstantiateModuleGraph(ModuleLoadRequest* aRequest) {
}
JS::Rooted<JSObject*> module(jsapi.cx(), moduleScript->ModuleRecord());
if (!xpc::Scriptability::Get(module).Allowed()) {
if (!xpc::Scriptability::AllowedIfExists(module)) {
return true;
}
@@ -1091,7 +1091,7 @@ nsresult ModuleLoaderBase::EvaluateModuleInContext(
JS::Rooted<JSObject*> module(aCx, moduleScript->ModuleRecord());
MOZ_ASSERT(module);
if (!xpc::Scriptability::Get(module).Allowed()) {
if (!xpc::Scriptability::AllowedIfExists(module)) {
return NS_OK;
}