For example, this should print hello
and world
, but doesn't print anything as the break
jumps straight to the end:
for (;;) {
try {
try {
break;
} finally {
console.log("hello");
}
} finally {
console.log("world");
}
}
Same for continue
, which jumps straight to the update block of the for loop:
for (var i = 0; i < 1; i++) {
try {
try {
continue;
} finally {
console.log("hello");
}
} finally {
console.log("world");
}
}
While not currently supported, this is also true for labelled continue
and break
:
outer: for (;;) {
try {
for (;;) {
try {
break outer;
} finally {
console.log("hello");
}
}
} finally {
console.log("world");
}
}
outer: for (var i = 0; i < 1; i++) {
try {
for (;;) {
try {
continue outer;
} finally {
console.log("hello");
}
}
} finally {
console.log("world");
}
}
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too