mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Remove {Bytecode::,}Interpreter::global_object()
The basic idea is that a global object cannot just come out of nowhere, it must be associated to a realm - so get it from there, if needed. This is to enforce the changes from all the previous commits by not handing out global objects unless you actually have an initialized realm (either stored somewhere, or the VM's current realm).
This commit is contained in:
@@ -365,7 +365,7 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path)
|
||||
executable->name = test_path;
|
||||
if (JS::Bytecode::g_dump_bytecode)
|
||||
executable->dump();
|
||||
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->global_object(), interpreter->realm());
|
||||
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->realm());
|
||||
MUST(bytecode_interpreter.run(*executable));
|
||||
} else {
|
||||
g_vm->push_execution_context(global_execution_context);
|
||||
@@ -383,7 +383,7 @@ inline JSFileResult TestRunner::run_file_test(String const& test_path)
|
||||
executable->name = test_path;
|
||||
if (JS::Bytecode::g_dump_bytecode)
|
||||
executable->dump();
|
||||
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->realm().global_object(), interpreter->realm());
|
||||
JS::Bytecode::Interpreter bytecode_interpreter(interpreter->realm());
|
||||
(void)bytecode_interpreter.run(*executable);
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user