From 1479cdb2a899f3c3f19f7d8800721169408d8204 Mon Sep 17 00:00:00 2001 From: y21 <30553356+y21@users.noreply.github.com> Date: Sat, 28 Dec 2024 19:51:23 +0100 Subject: [PATCH] don't use aliased name in object destructuring for the property --- crates/dash_compiler/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/dash_compiler/src/lib.rs b/crates/dash_compiler/src/lib.rs index c05858a4..36e42776 100644 --- a/crates/dash_compiler/src/lib.rs +++ b/crates/dash_compiler/src/lib.rs @@ -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()