Fix scoping and break statements.

Variables declared in the loop were not properly disposed of
when you broke out of the loop.
This commit is contained in:
Bob Nystrom
2014-01-06 08:01:04 -08:00
parent 90a769b6d1
commit 3be059a137
13 changed files with 208 additions and 62 deletions
+18
View File
@@ -0,0 +1,18 @@
for (i in 0..10) {
IO.print(i)
{
var a = "a"
{
var b = "b"
{
var c = "c"
if (i > 1) break
}
}
}
}
// expect: 0
// expect: 1
// expect: 2