Add a closure test.
This commit is contained in:
@@ -15,4 +15,3 @@
|
||||
}
|
||||
|
||||
// TODO: Maximum number of closed-over variables (directly and/or indirect).
|
||||
// TODO: Shadow variable used in closure.
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
var foo = "closure"
|
||||
new Fn {
|
||||
{
|
||||
IO.print(foo) // expect: closure
|
||||
var foo = "shadow"
|
||||
IO.print(foo) // expect: shadow
|
||||
}
|
||||
IO.print(foo) // expect: closure
|
||||
}.call
|
||||
}
|
||||
Reference in New Issue
Block a user