fix(compiler): 重写闭包捕获分析为 AST 级,修复 MAKE_CELL 时序

This commit is contained in:
爱特每羊队
2026-08-05 18:41:48 +08:00
parent 845ba2884a
commit 3390b61453
8 changed files with 506 additions and 318 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ impl Compiler {
return Ok(val_reg);
}
// Check if target is a captured cell
if ctx.scopes.symbols.lookup_is_captured(name) {
if ctx.captured_bindings.contains(name) {
let cell_idx = ctx
.scopes
.cell_registry