1
0
forked from Mirror/wren
Files
wren/test/break/closure_in_for.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

10 lines
97 B
Plaintext

var f
for (i in [1, 2, 3]) {
var j = 4
f = fn IO.print(i + j)
break
}
f.call
// expect: 5