rlox/interpreter/tests/lox/closure/reuse_closure_slot.lox
2024-09-01 19:15:55 +02:00

16 lines
238 B
Lox

{
var f;
{
var a = "a";
fun f_() { print a; }
f = f_;
}
{
// Since a is out of scope, the local slot will be reused by b. Make sure
// that f still closes over a.
var b = "b";
f(); // expect: a
}
}