Closed
Description
This is essentially me duplicating bellard/quickjs#275 here, since it seems to still affect quickjs-ng:
./qjs-linux-x86_64 -e 'for (var i=0; i<4; i++)
label: {
console.log(i);
if (i === 1) {
console.log("break");
break;
}
}'
prints
0
1
break
2
3
When the expected output does not print 2
or 3
.
In particular, this seems to be an issue when using quickjs with code created the js_of_ocaml Ocaml->JS compiler, as this has moved to heavy use of labels and break statements for ocsigen/js_of_ocaml#1496