mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 14:48:40 +01:00
Variables declared in the loop were not properly disposed of when you broke out of the loop.
20 lines
327 B
Plaintext
20 lines
327 B
Plaintext
for (i in 0..2) {
|
|
IO.print("outer " + i.toString)
|
|
if (i > 1) break
|
|
|
|
for (j in 0..2) {
|
|
IO.print("inner " + j.toString)
|
|
if (j > 1) break
|
|
}
|
|
}
|
|
|
|
// expect: outer 0
|
|
// expect: inner 0
|
|
// expect: inner 1
|
|
// expect: inner 2
|
|
// expect: outer 1
|
|
// expect: inner 0
|
|
// expect: inner 1
|
|
// expect: inner 2
|
|
// expect: outer 2
|