fix: class 类名绑定经 dedicated cell 捕获(C===Cv 恒等)+ upvalue 写入 const guard(getter 赋值抛 TypeError)

This commit is contained in:
爱特每羊队
2026-08-12 17:30:28 +08:00
parent 1323a0564b
commit 86a20fa1fe
10 changed files with 60 additions and 31 deletions
+1 -1
View File
@@ -1130,7 +1130,7 @@ impl Emitter {
);
// 类字段 computed key 数组等合成捕获:直接追加 upvalue(cell_idx 由父分配)。
for (name, cell_idx) in extra_upvalue_names {
if !ctx.current_upvalue_captures.iter().any(|u| u.name == *name) {
if !ctx.own_bindings.contains(*name) && !ctx.current_upvalue_captures.iter().any(|u| u.name == *name) {
ctx.current_upvalue_captures.push(UpvalueCapture {
name: (*name).to_string(),
enclosing_reg: 0,