If you have a loop (for, while) that is body-less and is terminated with a semicolon (rather than braces), and it's the last line in its block, the semicolon is removed, resulting in invalid code.
function f() {
while (g());
}
produces
function f(){while(g())}
which is invalid. REPL, although its use of check: true prevents you from actually seeing this output.
Good catch. Yeah, the check: true option should probably include the resulting broken code on the error object so we can still show the output, that's annoying
If you have a loop (
for
,while
) that is body-less and is terminated with a semicolon (rather than braces), and it's the last line in its block, the semicolon is removed, resulting in invalid code.produces
which is invalid. REPL, although its use of
check: true
prevents you from actually seeing this output.