From d49fb8a6919dfa446951bf83e14939ff2fc95db1 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Tue, 8 Sep 2020 11:00:27 +0000 Subject: Issue #618 - Clear the module map when changing a Document's global and add release build assertions for mismatching compartments. --- dom/html/nsHTMLDocument.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'dom/html') diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp index fc5268acc..b0747fb04 100644 --- a/dom/html/nsHTMLDocument.cpp +++ b/dom/html/nsHTMLDocument.cpp @@ -1511,6 +1511,9 @@ nsHTMLDocument::Open(JSContext* cx, // document again otherwise the document could have a non-zero onload block // count without the onload blocker request being in the loadgroup. EnsureOnloadBlocker(); + + // Throw away loaded modules created for the previous global. + ScriptLoader()->ClearModuleMap(); } // Step 8 - Clear all event listeners out of our DOM tree -- cgit v1.2.3