From d8686de401388c036ee02432cbcfa7b41272217d Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Sun, 2 Aug 2020 07:20:25 +0000 Subject: Issue #618 - Record module dependency before starting fetch so that error handling works correctly Ref BZ 1395896 --- dom/script/ScriptLoader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index 3dbbcacea..4050caada 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -793,6 +793,7 @@ ScriptLoader::StartFetchingModuleAndDependencies(ModuleLoadRequest* aRequest, childRequest->mIsInline = false; childRequest->mReferrerPolicy = aRequest->mReferrerPolicy; childRequest->mParent = aRequest; + aRequest->mImports.AppendElement(childRequest); RefPtr ready = childRequest->mReady.Ensure(__func__); @@ -803,7 +804,6 @@ ScriptLoader::StartFetchingModuleAndDependencies(ModuleLoadRequest* aRequest, return ready; } - aRequest->mImports.AppendElement(childRequest); return ready; } -- cgit v1.2.3