mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02: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:
Notes:
sideshowbarker
2024-07-17 07:52:44 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/275dea9d98 Pull-request: https://github.com/SerenityOS/serenity/pull/14973 Reviewed-by: https://github.com/davidot ✅
@@ -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