Bug 1803984 - Add assertion that we only remove unlinked modules from the map r=allstarschh
It would not be correct to remove modules that were already linked or evaluated. Depends on D178298 Differential Revision: https://phabricator.services.mozilla.com/D178787
This commit is contained in:
@@ -454,7 +454,14 @@ nsresult ModuleLoaderBase::GetFetchedModuleURLs(nsTArray<nsCString>& aURLs) {
|
||||
}
|
||||
|
||||
bool ModuleLoaderBase::RemoveFetchedModule(nsIURI* aURL) {
|
||||
MOZ_ASSERT(IsModuleFetched(aURL));
|
||||
#if defined(MOZ_DIAGNOSTIC_ASSERT_ENABLED)
|
||||
RefPtr<ModuleScript> ms;
|
||||
MOZ_ALWAYS_TRUE(mFetchedModules.Get(aURL, getter_AddRefs(ms)));
|
||||
if (ms && ms->ModuleRecord()) {
|
||||
JS::AssertModuleUnlinked(ms->ModuleRecord());
|
||||
}
|
||||
#endif
|
||||
|
||||
return mFetchedModules.Remove(aURL);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user