summaryrefslogtreecommitdiffstats
path: root/dom/script
diff options
context:
space:
mode:
Diffstat (limited to 'dom/script')
-rw-r--r--dom/script/ScriptLoader.cpp5
-rw-r--r--dom/script/ScriptLoader.h6
2 files changed, 11 insertions, 0 deletions
diff --git a/dom/script/ScriptLoader.cpp b/dom/script/ScriptLoader.cpp
index 71838580f..362c27f3e 100644
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -477,6 +477,11 @@ ScriptLoader::GetFetchedModule(nsIURI* aURL) const
return ms;
}
+void ScriptLoader::ClearModuleMap() {
+ MOZ_ASSERT(mFetchingModules.IsEmpty());
+ mFetchedModules.Clear();
+}
+
nsresult
ScriptLoader::ProcessFetchedModuleSource(ModuleLoadRequest* aRequest)
{
diff --git a/dom/script/ScriptLoader.h b/dom/script/ScriptLoader.h
index 2c5b683e7..73f2a9258 100644
--- a/dom/script/ScriptLoader.h
+++ b/dom/script/ScriptLoader.h
@@ -506,6 +506,12 @@ public:
return mPendingChildLoaders.AppendElement(aChild) != nullptr;
}
+ /*
+ * Clear the map of loaded modules. Called when a Document object is reused
+ * for a different global.
+ */
+ void ClearModuleMap();
+
private:
virtual ~ScriptLoader();