fix(compiler): 完善闭包捕获(cell 索引稳定、参数遮蔽、函数/类名捕获、b 槽立即数)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user