mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 16:41:52 +00:00
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:
parent
9e44d86915
commit
373307db5b
Notes:
github-actions[bot]
2025-04-27 23:25:13 +00:00
Author: https://github.com/awesomekling
Commit: 373307db5b
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4497
Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 3 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue