Skip to content

Commit

Permalink
LibWeb: Put an interpreter in scope for module script evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
networkException committed Oct 3, 2022
1 parent 7981d70 commit 2eb7597
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <AK/Debug.h>
#include <AK/Optional.h>
#include <AK/StringBuilder.h>
#include <LibJS/Interpreter.h>
#include <LibTextCodec/Decoder.h>
#include <LibWeb/Bindings/Intrinsics.h>
#include <LibWeb/DOM/Document.h>
Expand Down Expand Up @@ -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<JavaScriptModuleScript>(*m_script).run();
}
Expand Down

0 comments on commit 2eb7597

Please sign in to comment.