From 2eb759797e7601cfee90bf2742f1427713cc3d72 Mon Sep 17 00:00:00 2001 From: networkException Date: Mon, 3 Oct 2022 02:59:07 +0200 Subject: [PATCH] LibWeb: Put an interpreter in scope for module script evaluation --- Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 37996e9706194e7..d1d402c8c36d7ab 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -100,6 +101,8 @@ void HTMLScriptElement::execute_script() // 1. Assert: document's currentScript attribute is null. VERIFY(!document().current_script()); + JS::VM::InterpreterExecutionScope scope(*JS::Interpreter::create_with_existing_realm(realm())); + // 2. Run the module script given by the script's script for scriptElement. (void)verify_cast(*m_script).run(); }