feat: 捕获 cell 按绑定身份换键

This commit is contained in:
2026-10-05 14:32:42 +00:00
parent 5239ff74b8
commit 34e22c5519
12 changed files with 316 additions and 51 deletions
@@ -70,7 +70,7 @@ impl Emitter {
};
(target, false)
};
if let Some(&cell_idx) = ctx.captured_bindings.get(bi.name.as_str()) {
if let Some(cell_idx) = ctx.resolve_bind_cell_idx(bi.name.as_str()) {
// 被捕获绑定的 cell 在函数入口已实例化(undefined);声明语句
// 不赋值,仅首次声明刷新初值,已绑定的 cell 保留现值。
if !already_bound {