mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
66732e78ef
In this snippet... for (;;) label: break ...the break statement jumped back to the start of the loop instead of *out* of the loop. Fixes: https://github.com/quickjs-ng/quickjs/issues/741
19 lines
246 B
JavaScript
19 lines
246 B
JavaScript
import {assert} from "./assert.js"
|
|
|
|
while (1) label: break
|
|
|
|
var i = 0
|
|
while (i < 3) label: {
|
|
if (i > 0)
|
|
break
|
|
i++
|
|
}
|
|
assert(i, 1)
|
|
|
|
for (;;) label: break
|
|
|
|
for (i = 0; i < 3; i++) label: {
|
|
if (i > 0)
|
|
break
|
|
}
|
|
assert(i, 1)
|