LibJS: Mark arguments local as initialized after creating it

This avoids emitting an unnecessary TDZ check for the first time we
access the arguments object.
This commit is contained in:
Andreas Kling 2025-04-26 11:57:34 +02:00 committed by Andreas Kling
parent 9e44d86915
commit 373307db5b
Notes: github-actions[bot] 2025-04-27 23:25:13 +00:00

View file

@ -65,6 +65,9 @@ CodeGenerationErrorOr<void> Generator::emit_function_declaration_instantiation(E
} else {
emit<Op::CreateArguments>(dst, Op::CreateArguments::Kind::Mapped, function.is_strict_mode());
}
if (local_var_index.has_value())
set_local_initialized(Identifier::Local::variable(local_var_index.value()));
}
auto const& formal_parameters = function.formal_parameters();