I find it weird to put `{}` together. So I figured I would change it to have an empty line and ask for feedback :)

Beware: most of the test cases are not representative of real code, you almost never define blocks with no content in practice.
42 lines
671 B
Plaintext
42 lines
671 B
Plaintext
exports[`test break-continue.js 1`] = `
|
|
"function foo() {
|
|
while(true) { break; }
|
|
}
|
|
|
|
function bar() {
|
|
L: do { continue L; } while(false)
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
function foo() {
|
|
while (true) {
|
|
break;
|
|
}
|
|
}
|
|
|
|
function bar() {
|
|
L:
|
|
do {
|
|
continue L;
|
|
} while (false);
|
|
}
|
|
"
|
|
`;
|
|
|
|
exports[`test return.js 1`] = `
|
|
"function bar(x:number) { }
|
|
function foo() {
|
|
var x = null;
|
|
if (x == null) return;
|
|
bar(x);
|
|
}
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
function bar(x: number) {
|
|
}
|
|
function foo() {
|
|
var x = null;
|
|
if (x == null) return;
|
|
bar(x);
|
|
}
|
|
"
|
|
`;
|