From 2f145b6eda95c08a76711f0393e4d9ebe13a5f92 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 8 Jul 2020 10:50:53 +0000 Subject: Issue #618 - Fix error events fired when loading JS module dependencies fail When module dependencies fail, don't spam with errors for each import; only fire the error event once. Ref: BZ 1421259 --- dom/script/ScriptLoader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dom/script/ScriptLoader.cpp') diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp index a53098974..1426c30c9 100644 --- a/dom/script/ScriptLoader.cpp +++ b/dom/script/ScriptLoader.cpp @@ -2327,7 +2327,8 @@ ScriptLoader::OnStreamComplete(nsIIncrementalStreamLoader* aLoader, MOZ_ASSERT(!modReq->IsTopLevel()); MOZ_ASSERT(!modReq->isInList()); modReq->Cancel(); - FireScriptAvailable(rv, request); + // A single error is fired for the top level module, so don't use + // FireScriptAvailable here. } else if (mParserBlockingRequest == request) { MOZ_ASSERT(!request->isInList()); mParserBlockingRequest = nullptr; -- cgit v1.2.3