commit 2dbf29e59b81be42c9c0bb8692ac796ada97d371
parent aab59189a2c2b0063e121dcfdf4113d6e1a53631
Author: Yoshi Cheng-Hao Huang <allstars.chh@gmail.com>
Date: Fri, 3 Oct 2025 20:53:30 +0000
Bug 1968890 - Part 10: Check if the request has been canceled in reject handler. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D267274
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/js/loader/ModuleLoaderBase.cpp b/js/loader/ModuleLoaderBase.cpp
@@ -1337,6 +1337,11 @@ bool ModuleLoaderBase::OnLoadRequestedModulesRejected(
JSContext* aCx, ModuleLoadRequest* aRequest, Handle<Value> error) {
ModuleScript* moduleScript = aRequest->mModuleScript;
+ if (aRequest->IsCanceled()) {
+ aRequest->Release();
+ return true;
+ }
+
// TODO, Bug 1990416: Align the loading descendants behavior of dynamic import
if (aRequest->IsDynamicImport()) {
LOG(