fix: 对齐 counter/emitter 指令条数,修解构参数、数组赋值元素、解构catch、for-init 无初始化的跳转漂移

This commit is contained in:
爱特每羊队
2026-06-27 20:32:33 +08:00
parent 3c92f8368c
commit 242e94af09
7 changed files with 104 additions and 14 deletions
@@ -41,7 +41,8 @@ impl Compiler {
self.count_expression(init_expr, ctx);
self.count_binding_pattern(&d.id, ctx);
} else {
ctx.alloc_reg();
ctx.alloc_reg(); // tmp holding undefined
ctx.alloc_reg(); // var register
ctx.count_words(2); // LOAD_CONST(undefined) + STORE_VAR
}
}