diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /js/loader/ModuleLoaderBase.cpp | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/loader/ModuleLoaderBase.cpp')
-rw-r--r-- | js/loader/ModuleLoaderBase.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/js/loader/ModuleLoaderBase.cpp b/js/loader/ModuleLoaderBase.cpp index 59e77b2d9c..228c96ad69 100644 --- a/js/loader/ModuleLoaderBase.cpp +++ b/js/loader/ModuleLoaderBase.cpp @@ -969,7 +969,12 @@ void ModuleLoaderBase::FinishDynamicImport( LOG(("ScriptLoadRequest (%p): Finish dynamic import %x %d", aRequest, unsigned(aResult), JS_IsExceptionPending(aCx))); - MOZ_ASSERT(GetCurrentModuleLoader(aCx) == aRequest->mLoader); + MOZ_ASSERT_IF(NS_SUCCEEDED(aResult), + GetCurrentModuleLoader(aCx) == aRequest->mLoader); + // For failure case, aRequest may have already been unlinked by CC. + MOZ_ASSERT_IF( + NS_FAILED(aResult), + GetCurrentModuleLoader(aCx) == aRequest->mLoader || !aRequest->mLoader); // If aResult is a failed result, we don't have an EvaluationPromise. If it // succeeded, evaluationPromise may still be null, but in this case it will @@ -1057,7 +1062,8 @@ bool ModuleLoaderBase::HasPendingDynamicImports() const { void ModuleLoaderBase::CancelDynamicImport(ModuleLoadRequest* aRequest, nsresult aResult) { - MOZ_ASSERT(aRequest->mLoader == this); + // aRequest may have already been unlinked by CC. + MOZ_ASSERT(aRequest->mLoader == this || !aRequest->mLoader); RefPtr<ScriptLoadRequest> req = mDynamicImportRequests.Steal(aRequest); if (!aRequest->IsCanceled()) { |