Skip to content

Commit

Permalink
Fix mapped arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
HalidOdat committed Sep 25, 2023
1 parent 57b6e5a commit c336acd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boa_engine/src/bytecompiler/declarations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,13 +1037,18 @@ impl ByteCompiler<'_, '_> {
}
match parameter.variable().binding() {
Binding::Identifier(ident) => {
let function_environment_index =
arguments_object_needed.then(|| self.function_environment_index.take());
self.create_mutable_binding(*ident, false);
if let Some(init) = parameter.variable().init() {
let skip = self.emit_opcode_with_operand(Opcode::JumpIfNotUndefined);
self.compile_expr(init, true);
self.patch_jump(skip);
}
self.emit_binding(BindingOpcode::InitLet, *ident);
if let Some(function_environment_index) = function_environment_index {
self.function_environment_index = function_environment_index;
}
}
Binding::Pattern(pattern) => {
for ident in bound_names(pattern) {
Expand Down

0 comments on commit c336acd

Please sign in to comment.