From 0304f7bbbe0861bdd8cff54e400e5ae1fe0a53bc Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 20 Feb 2021 08:42:41 +0000 Subject: [PATCH] test-web: Create execution scope for new interpreter instead of the old one It was accidentally creating a scope for the old interpreter instead of the new one. Fixes #5415 --- Userland/Utilities/test-web.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Utilities/test-web.cpp b/Userland/Utilities/test-web.cpp index b63029ab53..040eb90a3e 100644 --- a/Userland/Utilities/test-web.cpp +++ b/Userland/Utilities/test-web.cpp @@ -306,9 +306,6 @@ JSFileResult TestRunner::run_file_test(const String& test_path) ASSERT(m_page_view->document()); auto& old_interpreter = m_page_view->document()->interpreter(); - // FIXME: This is a hack while we're refactoring Interpreter/VM stuff. - JS::VM::InterpreterExecutionScope scope(old_interpreter); - if (!m_js_test_common) { auto result = parse_file(String::format("%s/test-common.js", m_js_test_root.characters())); if (result.is_error()) { @@ -354,6 +351,9 @@ JSFileResult TestRunner::run_file_test(const String& test_path) Web::HTML::HTMLDocumentParser parser(document, data, "utf-8"); auto& new_interpreter = parser.document().interpreter(); + // FIXME: This is a hack while we're refactoring Interpreter/VM stuff. + JS::VM::InterpreterExecutionScope scope(new_interpreter); + // Setup the test environment and call "__BeforeInitialPageLoad__" new_interpreter.global_object().define_property( "libweb_tester",