From 32d9c8e3ca8d6c88d06fc8afc0f8cdd9635ff3c4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 15 Jun 2023 10:37:42 +0200 Subject: [PATCH] LibJS: Make GlobalDeclarationInstantiation take a VM& This doesn't need to take an AST Interpreter&. --- Userland/Libraries/LibJS/AST.cpp | 3 +-- Userland/Libraries/LibJS/AST.h | 2 +- Userland/Libraries/LibJS/Interpreter.cpp | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 44cb734ce8..a234a0066f 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -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 Program::global_declaration_instantiation(Interpreter& interpreter, GlobalEnvironment& global_environment) const +ThrowCompletionOr 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. diff --git a/Userland/Libraries/LibJS/AST.h b/Userland/Libraries/LibJS/AST.h index 3f36831327..b50f1ada1e 100644 --- a/Userland/Libraries/LibJS/AST.h +++ b/Userland/Libraries/LibJS/AST.h @@ -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 global_declaration_instantiation(Interpreter&, GlobalEnvironment&) const; + ThrowCompletionOr global_declaration_instantiation(VM&, GlobalEnvironment&) const; private: virtual bool is_program() const override { return true; } diff --git a/Userland/Libraries/LibJS/Interpreter.cpp b/Userland/Libraries/LibJS/Interpreter.cpp index 2dc3be1e19..166a79a816 100644 --- a/Userland/Libraries/LibJS/Interpreter.cpp +++ b/Userland/Libraries/LibJS/Interpreter.cpp @@ -80,7 +80,7 @@ ThrowCompletionOr Interpreter::run(Script& script_record, JS::GCPtr