Bug 1666419: Assert IsSafeToRunScript. r=emilio

Differential Revision: https://phabricator.services.mozilla.com/D91391
This commit is contained in:
Christoph Kerschbaumer
2020-09-28 06:29:44 +00:00
parent 4cc7241944
commit 3e0591366c
10 changed files with 90 additions and 0 deletions

View File

@@ -546,6 +546,9 @@ nsresult ScriptLoader::CreateModuleScript(ModuleLoadRequest* aRequest) {
}
nsAutoMicroTask mt;
AutoAllowLegacyScriptExecution exemption;
AutoEntryScript aes(globalObject, "CompileModule", true);
bool oldProcessingScriptTag = context->GetProcessingScriptTag();
@@ -3223,6 +3226,7 @@ void ScriptLoader::GiveUpBytecodeEncoding() {
// removal of all request from the current list and these large buffers would
// be removed at the same time as the source object.
nsCOMPtr<nsIScriptGlobalObject> globalObject = GetScriptGlobalObject();
AutoAllowLegacyScriptExecution exemption;
Maybe<AutoEntryScript> aes;
if (globalObject) {