- This brings in the flow test suite that contains a ton of JavaScript parsing edge cases - This creates snapshot tests using the pretty printer for all of them - If uncomment `RUN_AST_TESTS` line in `tests/run_specs.js`, it checks ast(pretty_print(x)) == ast(x). Right now, "178 failed, 197 passed, 375 of 377 total". So half of the tests are not passing, most of them are crashes and many of the rest are subtle issues.
48 lines
865 B
JavaScript
48 lines
865 B
JavaScript
/* @flow */
|
|
|
|
function foo(x: boolean) {
|
|
var max = 10;
|
|
for (var ii = 0; ii < max; ii++) {
|
|
if (x) {
|
|
continue;
|
|
}
|
|
return;
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|
|
|
|
function bar(x: boolean) {
|
|
var max = 0;
|
|
for (var ii = 0; ii < max; ii++) {
|
|
return;
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|
|
|
|
function baz(x: boolean) {
|
|
var max = 0;
|
|
for (var ii = 0; ii < max; ii++) {
|
|
continue;
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|
|
|
|
function bliffl(x: boolean) {
|
|
var max = 10;
|
|
loop1: for (var ii = 0; ii < max; ii++) {
|
|
loop2: for (var jj = 0; jj < max; jj++) {
|
|
break loop1;
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|
|
|
|
function corge(x: boolean) {
|
|
var max = 0;
|
|
for (var ii = 0; ii < max; ii++) {
|
|
break;
|
|
}
|
|
console.log('this is still reachable');
|
|
}
|