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:
Linus Groh 2022-08-22 19:35:23 +01:00
commit 275dea9d98
Notes: sideshowbarker 2024-07-17 07:52:44 +09:00
10 changed files with 15 additions and 37 deletions

View file

@ -20,7 +20,7 @@
\
auto script = script_or_error.release_value(); \
auto const& program = script->parse_node(); \
JS::Bytecode::Interpreter bytecode_interpreter(ast_interpreter->global_object(), ast_interpreter->realm());
JS::Bytecode::Interpreter bytecode_interpreter(ast_interpreter->realm());
#define EXPECT_NO_EXCEPTION(executable) \
auto executable = MUST(JS::Bytecode::Generator::generate(program)); \