Skip to content

Commit

Permalink
don't use aliased name in object destructuring for the property
Browse files Browse the repository at this point in the history
  • Loading branch information
y21 committed Dec 28, 2024
1 parent 3af6a7c commit 1479cdb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/dash_compiler/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2422,8 +2422,10 @@ fn compile_destructuring_pattern(
ib.build_objdestruct(field_count, rest_id);

for &(local, name, alias, ref default) in fields {
let name = alias.unwrap_or(name);
let id = ib.find_local_from_binding(Binding { id: local, ident: name });
let id = ib.find_local_from_binding(Binding {
id: local,
ident: alias.unwrap_or(name),
});

let NumberConstant(var_id) = ib
.current_function_mut()
Expand Down

0 comments on commit 1479cdb

Please sign in to comment.