mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibJS: Make GlobalDeclarationInstantiation take a VM&
This doesn't need to take an AST Interpreter&.
This commit is contained in:
parent
872d798951
commit
32d9c8e3ca
Notes:
sideshowbarker
2024-07-17 07:19:27 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/32d9c8e3ca Pull-request: https://github.com/SerenityOS/serenity/pull/19408 Issue: https://github.com/SerenityOS/serenity/issues/15210
3 changed files with 3 additions and 4 deletions
|
@ -4760,9 +4760,8 @@ void ScopeNode::block_declaration_instantiation(Interpreter& interpreter, Enviro
|
|||
}
|
||||
|
||||
// 16.1.7 GlobalDeclarationInstantiation ( script, env ), https://tc39.es/ecma262/#sec-globaldeclarationinstantiation
|
||||
ThrowCompletionOr<void> Program::global_declaration_instantiation(Interpreter& interpreter, GlobalEnvironment& global_environment) const
|
||||
ThrowCompletionOr<void> Program::global_declaration_instantiation(VM& vm, GlobalEnvironment& global_environment) const
|
||||
{
|
||||
auto& vm = interpreter.vm();
|
||||
auto& realm = *vm.current_realm();
|
||||
|
||||
// 1. Let lexNames be the LexicallyDeclaredNames of script.
|
||||
|
|
|
@ -537,7 +537,7 @@ public:
|
|||
bool has_top_level_await() const { return m_has_top_level_await; }
|
||||
void set_has_top_level_await() { m_has_top_level_await = true; }
|
||||
|
||||
ThrowCompletionOr<void> global_declaration_instantiation(Interpreter&, GlobalEnvironment&) const;
|
||||
ThrowCompletionOr<void> global_declaration_instantiation(VM&, GlobalEnvironment&) const;
|
||||
|
||||
private:
|
||||
virtual bool is_program() const override { return true; }
|
||||
|
|
|
@ -80,7 +80,7 @@ ThrowCompletionOr<Value> Interpreter::run(Script& script_record, JS::GCPtr<Envir
|
|||
auto& script = script_record.parse_node();
|
||||
|
||||
// 12. Let result be Completion(GlobalDeclarationInstantiation(script, globalEnv)).
|
||||
auto instantiation_result = script.global_declaration_instantiation(*this, global_environment);
|
||||
auto instantiation_result = script.global_declaration_instantiation(vm, global_environment);
|
||||
Completion result = instantiation_result.is_throw_completion() ? instantiation_result.throw_completion() : normal_completion({});
|
||||
|
||||
// 13. If result.[[Type]] is normal, then
|
||||
|
|
Loading…
Reference in a new issue