1
0
forked from Mirror/wren
Files
wren/test/for/close_over_loop_variable.wren
Bob Nystrom 3be059a137 Fix scoping and break statements.
Variables declared in the loop were not properly disposed of
when you broke out of the loop.
2014-01-06 08:01:04 -08:00

11 lines
130 B
Plaintext

var list = []
for (i in [1, 2, 3]) {
list.add(fn IO.print(i))
}
for (f in list) f.call
// expect: 1
// expect: 2
// expect: 3