diff --git a/Libraries/LibJS/AST.cpp b/Libraries/LibJS/AST.cpp index 291fac8dfd0..8191c09ec63 100644 --- a/Libraries/LibJS/AST.cpp +++ b/Libraries/LibJS/AST.cpp @@ -241,7 +241,7 @@ ThrowCompletionOr ClassField::class_element_evaluation FunctionParsingInsights parsing_insights; parsing_insights.uses_this_from_environment = true; parsing_insights.uses_this = true; - initializer = ECMAScriptFunctionObject::create(realm, "field"_string, ByteString::empty(), *function_code, {}, 0, {}, vm.lexical_environment(), vm.running_execution_context().private_environment, FunctionKind::Normal, true, parsing_insights, false, property_key_or_private_name); + initializer = ECMAScriptFunctionObject::create(realm, "field"_string, ByteString::empty(), *function_code, FunctionParameters::empty(), 0, {}, vm.lexical_environment(), vm.running_execution_context().private_environment, FunctionKind::Normal, true, parsing_insights, false, property_key_or_private_name); initializer->make_method(target); } @@ -288,7 +288,7 @@ ThrowCompletionOr StaticInitializer::class_element_eva FunctionParsingInsights parsing_insights; parsing_insights.uses_this_from_environment = true; parsing_insights.uses_this = true; - auto body_function = ECMAScriptFunctionObject::create(realm, ""_string, ByteString::empty(), *m_function_body, {}, 0, m_function_body->local_variables_names(), lexical_environment, private_environment, FunctionKind::Normal, true, parsing_insights, false); + auto body_function = ECMAScriptFunctionObject::create(realm, ""_string, ByteString::empty(), *m_function_body, FunctionParameters::empty(), 0, m_function_body->local_variables_names(), lexical_environment, private_environment, FunctionKind::Normal, true, parsing_insights, false); // 6. Perform MakeMethod(bodyFunction, homeObject). body_function->make_method(home_object); @@ -833,11 +833,11 @@ void FunctionNode::dump(int indent, ByteString const& class_name) const print_indent(indent + 1); outln("\033[31;1m(direct eval)\033[0m"); } - if (!m_parameters.is_empty()) { + if (!m_parameters->is_empty()) { print_indent(indent + 1); outln("(Parameters)"); - for (auto& parameter : m_parameters) { + for (auto& parameter : m_parameters->parameters()) { parameter.binding.visit( [&](Identifier const& identifier) { if (parameter.is_rest) { @@ -1880,4 +1880,10 @@ NonnullRefPtr NewExpression::create(SourceRange source_range, Non return ASTNodeWithTailArray::create(arguments.size(), move(source_range), move(callee), arguments, invocation_style, inside_parens); } +NonnullRefPtr FunctionParameters::empty() +{ + static auto empty = adopt_ref(*new FunctionParameters({})); + return empty; +} + } diff --git a/Libraries/LibJS/AST.h b/Libraries/LibJS/AST.h index e5f8fedfe45..0375ec1d037 100644 --- a/Libraries/LibJS/AST.h +++ b/Libraries/LibJS/AST.h @@ -692,6 +692,28 @@ struct FunctionParameter { GC::Root bytecode_executable {}; }; +class FunctionParameters : public RefCounted { +public: + static NonnullRefPtr create(Vector parameters) + { + return adopt_ref(*new FunctionParameters(move(parameters))); + } + + static NonnullRefPtr empty(); + + bool is_empty() const { return m_parameters.is_empty(); } + size_t size() const { return m_parameters.size(); } + Vector const& parameters() const { return m_parameters; } + +private: + FunctionParameters(Vector parameters) + : m_parameters(move(parameters)) + { + } + + Vector m_parameters; +}; + struct FunctionParsingInsights { bool uses_this { false }; bool uses_this_from_environment { false }; @@ -705,7 +727,8 @@ public: RefPtr name_identifier() const { return m_name; } ByteString const& source_text() const { return m_source_text; } Statement const& body() const { return *m_body; } - Vector const& parameters() const { return m_parameters; } + auto const& body_ptr() const { return m_body; } + auto const& parameters() const { return m_parameters; } i32 function_length() const { return m_function_length; } Vector const& local_variables_names() const { return m_local_variables_names; } bool is_strict_mode() const { return m_is_strict_mode; } @@ -722,7 +745,7 @@ public: virtual ~FunctionNode() { } protected: - FunctionNode(RefPtr name, ByteString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights parsing_insights, bool is_arrow_function, Vector local_variables_names) + FunctionNode(RefPtr name, ByteString source_text, NonnullRefPtr body, NonnullRefPtr parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights parsing_insights, bool is_arrow_function, Vector local_variables_names) : m_name(move(name)) , m_source_text(move(source_text)) , m_body(move(body)) @@ -745,7 +768,7 @@ protected: private: ByteString m_source_text; NonnullRefPtr m_body; - Vector const m_parameters; + NonnullRefPtr m_parameters; i32 const m_function_length; FunctionKind m_kind; bool m_is_strict_mode : 1 { false }; @@ -761,7 +784,7 @@ class FunctionDeclaration final public: static bool must_have_name() { return true; } - FunctionDeclaration(SourceRange source_range, RefPtr name, ByteString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights insights, Vector local_variables_names) + FunctionDeclaration(SourceRange source_range, RefPtr name, ByteString source_text, NonnullRefPtr body, NonnullRefPtr parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights insights, Vector local_variables_names) : Declaration(move(source_range)) , FunctionNode(move(name), move(source_text), move(body), move(parameters), function_length, kind, is_strict_mode, insights, false, move(local_variables_names)) { @@ -791,7 +814,7 @@ class FunctionExpression final public: static bool must_have_name() { return false; } - FunctionExpression(SourceRange source_range, RefPtr name, ByteString source_text, NonnullRefPtr body, Vector parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights insights, Vector local_variables_names, bool is_arrow_function = false) + FunctionExpression(SourceRange source_range, RefPtr name, ByteString source_text, NonnullRefPtr body, NonnullRefPtr parameters, i32 function_length, FunctionKind kind, bool is_strict_mode, FunctionParsingInsights insights, Vector local_variables_names, bool is_arrow_function = false) : Expression(move(source_range)) , FunctionNode(move(name), move(source_text), move(body), move(parameters), function_length, kind, is_strict_mode, insights, is_arrow_function, move(local_variables_names)) { diff --git a/Libraries/LibJS/Bytecode/Generator.cpp b/Libraries/LibJS/Bytecode/Generator.cpp index 1c9d50f8508..19daee2b2bf 100644 --- a/Libraries/LibJS/Bytecode/Generator.cpp +++ b/Libraries/LibJS/Bytecode/Generator.cpp @@ -68,8 +68,8 @@ CodeGenerationErrorOr Generator::emit_function_declaration_instantiation(E } auto const& formal_parameters = function.formal_parameters(); - for (u32 param_index = 0; param_index < formal_parameters.size(); ++param_index) { - auto const& parameter = formal_parameters[param_index]; + for (u32 param_index = 0; param_index < formal_parameters->size(); ++param_index) { + auto const& parameter = formal_parameters->parameters()[param_index]; if (parameter.is_rest) { auto argument_reg = allocate_register(); diff --git a/Libraries/LibJS/Forward.h b/Libraries/LibJS/Forward.h index b5f4a53f737..8caf3538382 100644 --- a/Libraries/LibJS/Forward.h +++ b/Libraries/LibJS/Forward.h @@ -179,6 +179,7 @@ class ForStatement; class FunctionEnvironment; class FunctionNode; struct FunctionParameter; +class FunctionParameters; class GlobalEnvironment; class GlobalObject; struct GraphLoadingState; diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp index 161d0cc4fb3..1144fa62da9 100644 --- a/Libraries/LibJS/Parser.cpp +++ b/Libraries/LibJS/Parser.cpp @@ -1136,7 +1136,7 @@ RefPtr Parser::try_parse_arrow_function_expression(boo auto source_text = ByteString { m_state.lexer.source().substring_view(function_start_offset, function_end_offset - function_start_offset) }; return create_ast_node( { m_source_code, rule_start.position(), position() }, nullptr, move(source_text), - move(body), move(parameters), function_length, function_kind, body->in_strict_mode(), + move(body), FunctionParameters::create(move(parameters)), function_length, function_kind, body->in_strict_mode(), parsing_insights, move(local_variables_names), /* is_arrow_function */ true); } @@ -1633,13 +1633,13 @@ NonnullRefPtr Parser::parse_class_expression(bool expect_ FunctionParsingInsights parsing_insights; constructor = create_ast_node( { m_source_code, rule_start.position(), position() }, class_name, "", - move(constructor_body), Vector { FunctionParameter { move(argument_name), nullptr, true } }, 0, FunctionKind::Normal, + move(constructor_body), FunctionParameters::create(Vector { FunctionParameter { move(argument_name), nullptr, true } }), 0, FunctionKind::Normal, /* is_strict_mode */ true, parsing_insights, /* local_variables_names */ Vector {}); } else { FunctionParsingInsights parsing_insights; constructor = create_ast_node( { m_source_code, rule_start.position(), position() }, class_name, "", - move(constructor_body), Vector {}, 0, FunctionKind::Normal, + move(constructor_body), FunctionParameters::empty(), 0, FunctionKind::Normal, /* is_strict_mode */ true, parsing_insights, /* local_variables_names */ Vector {}); } } @@ -2991,7 +2991,7 @@ NonnullRefPtr Parser::parse_function_node(u16 parse_options, O parsing_insights.might_need_arguments_object = m_state.function_might_need_arguments_object; return create_ast_node( { m_source_code, rule_start.position(), position() }, - name, move(source_text), move(body), move(parameters), function_length, + name, move(source_text), move(body), FunctionParameters::create(move(parameters)), function_length, function_kind, has_strict_directive, parsing_insights, move(local_variables_names)); } diff --git a/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Libraries/LibJS/Runtime/AbstractOperations.cpp index e089063eb10..00a30a287e6 100644 --- a/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -1074,7 +1074,7 @@ Object* create_unmapped_arguments_object(VM& vm, ReadonlySpan arguments) } // 10.4.4.7 CreateMappedArgumentsObject ( func, formals, argumentsList, env ), https://tc39.es/ecma262/#sec-createmappedargumentsobject -Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, Vector const& formals, ReadonlySpan arguments, Environment& environment) +Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, NonnullRefPtr const& formals, ReadonlySpan arguments, Environment& environment) { auto& realm = *vm.current_realm(); @@ -1113,10 +1113,10 @@ Object* create_mapped_arguments_object(VM& vm, FunctionObject& function, Vector< // 18. Set index to numberOfParameters - 1. // 19. Repeat, while index ≥ 0, - VERIFY(formals.size() <= NumericLimits::max()); - for (i32 index = static_cast(formals.size()) - 1; index >= 0; --index) { + VERIFY(formals->size() <= NumericLimits::max()); + for (i32 index = static_cast(formals->size()) - 1; index >= 0; --index) { // a. Let name be parameterNames[index]. - auto const& name = formals[index].binding.get>()->string(); + auto const& name = formals->parameters()[index].binding.get>()->string(); // b. If name is not an element of mappedNames, then if (mapped_names.contains(name)) diff --git a/Libraries/LibJS/Runtime/AbstractOperations.h b/Libraries/LibJS/Runtime/AbstractOperations.h index 68847e7c869..06ca28c0ded 100644 --- a/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Libraries/LibJS/Runtime/AbstractOperations.h @@ -43,7 +43,7 @@ bool is_compatible_property_descriptor(bool extensible, PropertyDescriptor const bool validate_and_apply_property_descriptor(Object*, PropertyKey const&, bool extensible, PropertyDescriptor const&, Optional const& current); ThrowCompletionOr get_prototype_from_constructor(VM&, FunctionObject const& constructor, GC::Ref (Intrinsics::*intrinsic_default_prototype)()); Object* create_unmapped_arguments_object(VM&, ReadonlySpan arguments); -Object* create_mapped_arguments_object(VM&, FunctionObject&, Vector const&, ReadonlySpan arguments, Environment&); +Object* create_mapped_arguments_object(VM&, FunctionObject&, NonnullRefPtr const&, ReadonlySpan arguments, Environment&); // 2.1.1 DisposeCapability Records, https://tc39.es/proposal-explicit-resource-management/#sec-disposecapability-records struct DisposeCapability { diff --git a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp index 01a9eed4b87..ba2bd28ceaf 100644 --- a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp +++ b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.cpp @@ -33,7 +33,7 @@ namespace JS { GC_DEFINE_ALLOCATOR(ECMAScriptFunctionObject); -GC::Ref ECMAScriptFunctionObject::create(Realm& realm, FlyString name, ByteString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) +GC::Ref ECMAScriptFunctionObject::create(Realm& realm, FlyString name, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) { Object* prototype = nullptr; switch (kind) { @@ -53,12 +53,12 @@ GC::Ref ECMAScriptFunctionObject::create(Realm& realm, return realm.create(move(name), move(source_text), ecmascript_code, move(parameters), m_function_length, move(local_variables_names), parent_environment, private_environment, *prototype, kind, is_strict, parsing_insights, is_arrow_function, move(class_field_initializer_name)); } -GC::Ref ECMAScriptFunctionObject::create(Realm& realm, FlyString name, Object& prototype, ByteString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) +GC::Ref ECMAScriptFunctionObject::create(Realm& realm, FlyString name, Object& prototype, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind kind, bool is_strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) { return realm.create(move(name), move(source_text), ecmascript_code, move(parameters), m_function_length, move(local_variables_names), parent_environment, private_environment, prototype, kind, is_strict, parsing_insights, is_arrow_function, move(class_field_initializer_name)); } -ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, ByteString source_text, Statement const& ecmascript_code, Vector formal_parameters, i32 function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind kind, bool strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) +ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr formal_parameters, i32 function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind kind, bool strict, FunctionParsingInsights parsing_insights, bool is_arrow_function, Variant class_field_initializer_name) : FunctionObject(prototype) , m_name(move(name)) , m_function_length(function_length) @@ -92,7 +92,7 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, ByteString so m_script_or_module = vm().get_active_script_or_module(); // 15.1.3 Static Semantics: IsSimpleParameterList, https://tc39.es/ecma262/#sec-static-semantics-issimpleparameterlist - m_has_simple_parameter_list = all_of(m_formal_parameters, [&](auto& parameter) { + m_has_simple_parameter_list = all_of(m_formal_parameters->parameters(), [&](auto& parameter) { if (parameter.is_rest) return false; if (parameter.default_value) @@ -121,7 +121,7 @@ ECMAScriptFunctionObject::ECMAScriptFunctionObject(FlyString name, ByteString so size_t parameters_in_environment = 0; // NOTE: This loop performs step 5, 6, and 8. - for (auto const& parameter : formals) { + for (auto const& parameter : formals->parameters()) { if (parameter.default_value) m_has_parameter_expressions = true; @@ -385,11 +385,11 @@ ThrowCompletionOr ECMAScriptFunctionObject::internal_call(Value this_argu auto callee_context = ExecutionContext::create(); // Non-standard - callee_context->arguments.ensure_capacity(max(arguments_list.size(), m_formal_parameters.size())); + callee_context->arguments.ensure_capacity(max(arguments_list.size(), m_formal_parameters->size())); callee_context->arguments.append(arguments_list.data(), arguments_list.size()); callee_context->passed_argument_count = arguments_list.size(); - if (arguments_list.size() < m_formal_parameters.size()) { - for (size_t i = arguments_list.size(); i < m_formal_parameters.size(); ++i) + if (arguments_list.size() < m_formal_parameters->size()) { + for (size_t i = arguments_list.size(); i < m_formal_parameters->size(); ++i) callee_context->arguments.append(js_undefined()); } @@ -442,11 +442,11 @@ ThrowCompletionOr> ECMAScriptFunctionObject::internal_construct( auto callee_context = ExecutionContext::create(); // Non-standard - callee_context->arguments.ensure_capacity(max(arguments_list.size(), m_formal_parameters.size())); + callee_context->arguments.ensure_capacity(max(arguments_list.size(), m_formal_parameters->size())); callee_context->arguments.append(arguments_list.data(), arguments_list.size()); callee_context->passed_argument_count = arguments_list.size(); - if (arguments_list.size() < m_formal_parameters.size()) { - for (size_t i = arguments_list.size(); i < m_formal_parameters.size(); ++i) + if (arguments_list.size() < m_formal_parameters->size()) { + for (size_t i = arguments_list.size(); i < m_formal_parameters->size(); ++i) callee_context->arguments.append(js_undefined()); } diff --git a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h index 9cd46617883..d9142ba6a8b 100644 --- a/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h +++ b/Libraries/LibJS/Runtime/ECMAScriptFunctionObject.h @@ -39,8 +39,8 @@ public: Global, }; - static GC::Ref create(Realm&, FlyString name, ByteString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function = false, Variant class_field_initializer_name = {}); - static GC::Ref create(Realm&, FlyString name, Object& prototype, ByteString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function = false, Variant class_field_initializer_name = {}); + static GC::Ref create(Realm&, FlyString name, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function = false, Variant class_field_initializer_name = {}); + static GC::Ref create(Realm&, FlyString name, Object& prototype, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function = false, Variant class_field_initializer_name = {}); virtual void initialize(Realm&) override; virtual ~ECMAScriptFunctionObject() override = default; @@ -54,7 +54,7 @@ public: void set_is_module_wrapper(bool b) { m_is_module_wrapper = b; } Statement const& ecmascript_code() const { return m_ecmascript_code; } - Vector const& formal_parameters() const override { return m_formal_parameters; } + virtual NonnullRefPtr const& formal_parameters() const override { return m_formal_parameters; } virtual FlyString const& name() const override { return m_name; } void set_name(FlyString const& name); @@ -109,7 +109,7 @@ protected: virtual Completion ordinary_call_evaluate_body(); private: - ECMAScriptFunctionObject(FlyString name, ByteString source_text, Statement const& ecmascript_code, Vector parameters, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function, Variant class_field_initializer_name); + ECMAScriptFunctionObject(FlyString name, ByteString source_text, Statement const& ecmascript_code, NonnullRefPtr, i32 m_function_length, Vector local_variables_names, Environment* parent_environment, PrivateEnvironment* private_environment, Object& prototype, FunctionKind, bool is_strict, FunctionParsingInsights, bool is_arrow_function, Variant class_field_initializer_name); virtual bool is_ecmascript_function_object() const override { return true; } virtual void visit_edges(Visitor&) override; @@ -127,7 +127,7 @@ private: // Internal Slots of ECMAScript Function Objects, https://tc39.es/ecma262/#table-internal-slots-of-ecmascript-function-objects GC::Ptr m_environment; // [[Environment]] GC::Ptr m_private_environment; // [[PrivateEnvironment]] - Vector const m_formal_parameters; // [[FormalParameters]] + NonnullRefPtr m_formal_parameters; // [[FormalParameters]] NonnullRefPtr m_ecmascript_code; // [[ECMAScriptCode]] GC::Ptr m_realm; // [[Realm]] ScriptOrModule m_script_or_module; // [[ScriptOrModule]] diff --git a/Libraries/LibJS/Runtime/FunctionObject.h b/Libraries/LibJS/Runtime/FunctionObject.h index 55176f99de1..d875d9f6a4f 100644 --- a/Libraries/LibJS/Runtime/FunctionObject.h +++ b/Libraries/LibJS/Runtime/FunctionObject.h @@ -40,7 +40,7 @@ public: virtual Vector const& local_variables_names() const { VERIFY_NOT_REACHED(); } - virtual Vector const& formal_parameters() const { VERIFY_NOT_REACHED(); } + virtual NonnullRefPtr const& formal_parameters() const { VERIFY_NOT_REACHED(); } protected: explicit FunctionObject(Realm&, Object* prototype, MayInterfereWithIndexedPropertyAccess = MayInterfereWithIndexedPropertyAccess::No); diff --git a/Libraries/LibJS/SourceTextModule.cpp b/Libraries/LibJS/SourceTextModule.cpp index af33db03f79..2a2fbd62687 100644 --- a/Libraries/LibJS/SourceTextModule.cpp +++ b/Libraries/LibJS/SourceTextModule.cpp @@ -770,7 +770,7 @@ ThrowCompletionOr SourceTextModule::execute_module(VM& vm, GC::Ptrm_ecmascript_code, - {}, 0, {}, environment(), nullptr, FunctionKind::Async, true, parsing_insights); + FunctionParameters::empty(), 0, {}, environment(), nullptr, FunctionKind::Async, true, parsing_insights); module_wrapper_function->set_is_module_wrapper(true); vm.pop_execution_context();