fix(compiler): 完善闭包捕获(cell 索引稳定、参数遮蔽、函数/类名捕获、b 槽立即数)

This commit is contained in:
爱特每羊队
2026-08-05 19:19:29 +08:00
parent 3390b61453
commit b611e26f11
11 changed files with 87 additions and 70 deletions
+8
View File
@@ -120,3 +120,11 @@ fn multiple_arrows_in_same_scope() {
// // const o = {x:10, f:function(){ return (() => this.x)(); }}; o.f()
// // Expected: 10
// }
// -- Closure capture diagnostics --
#[test]
fn closure_captures_outer_let() {
assert_eq!(eval("var f; { let x = 7; f = () => x; } f()"), "7");
}