LibJS+LibWeb: Pass function metadata collected in parsing using a struct

By using separate struct we can avoid updating AST node and
ECMAScriptFunctionObject constructors every time there is a need to
add or remove some additional information colllected during parsing.
This commit is contained in:
Aliaksandr Kalenik 2024-05-22 11:04:50 +01:00 committed by Andreas Kling
commit e934132442
Notes: sideshowbarker 2024-07-17 09:49:48 +09:00
12 changed files with 75 additions and 73 deletions

View file

@ -486,7 +486,7 @@ WebIDL::CallbackType* EventTarget::get_current_value_of_event_handler(FlyString
// 6. Return scope. (NOTE: Not necessary)
auto function = JS::ECMAScriptFunctionObject::create(realm, name.to_deprecated_fly_string(), builder.to_byte_string(), program->body(), program->parameters(), program->function_length(), program->local_variables_names(), scope, nullptr, JS::FunctionKind::Normal, program->is_strict_mode(),
program->uses_this_from_environment(), program->might_need_arguments_object(), is_arrow_function);
program->parsing_insights(), is_arrow_function);
// 10. Remove settings object's realm execution context from the JavaScript execution context stack.
VERIFY(vm.execution_context_stack().last() == &settings_object.realm_execution_context());