1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:37:35 +00:00

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
This commit is contained in:
Luke 2021-02-20 08:42:41 +00:00 committed by Andreas Kling
parent 7e959d7430
commit 0304f7bbbe

View file

@ -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",