feat: 解构计算键通用 fallback 支持任意键表达式

This commit is contained in:
2026-08-16 13:49:17 +08:00
parent 457b1b874d
commit fd2b290927
2 changed files with 93 additions and 1 deletions
+3 -1
View File
@@ -286,7 +286,9 @@ impl Emitter {
ctx.inst(Inst::load_const(Operand::Reg(key_reg), key_idx));
Ok(key_reg)
}
_ => Err("computed destructuring key expression not supported".into()),
// 其余键形态(CallExpression/Template/BigInt/RegExp 等):转回 Expression
// 走通用 emit 分发,键值运行时求值后由 GET_PROP_DYNAMIC 做 ToPropertyKey。
_ => self.emit_expression(key.to_expression(), ctx),
}
}