2016-12-23 22:31:38 +03:00
|
|
|
exports[`test abnormal.js 1`] = `
|
|
|
|
"/* @flow */
|
|
|
|
|
|
|
|
function foo(x: boolean) {
|
|
|
|
var max = 10;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bar(x: boolean) {
|
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function baz(x: boolean) {
|
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function corge(x: boolean) {
|
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
/* @flow */
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function foo(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var max = 10;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bar(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function baz(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bliffl(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var max = 10;
|
2016-12-23 22:31:38 +03:00
|
|
|
loop1:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var ii = 0; ii < max; ii++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
loop2:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var jj = 0; jj < max; jj++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
break loop1;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function corge(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var max = 0;
|
|
|
|
for (var ii = 0; ii < max; ii++) {
|
2016-12-23 22:31:38 +03:00
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2017-01-11 18:16:38 +03:00
|
|
|
}
|
|
|
|
"
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test abnormal_for_in.js 1`] = `
|
|
|
|
"function foo(x: boolean) {
|
|
|
|
var obj = { a: 1, b: 2};
|
|
|
|
for (var prop in obj) {
|
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bar(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function baz(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bliffl(x: boolean) {
|
|
|
|
var obj = { a: 1, b: 2};
|
|
|
|
loop1: for (var prop1 in obj) {
|
|
|
|
loop2: for (var prop2 in obj) {
|
|
|
|
break loop1;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function corge(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
function foo(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var obj = { a: 1, b: 2 };
|
2016-12-23 22:31:38 +03:00
|
|
|
for (var prop in obj) {
|
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bar(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function baz(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bliffl(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var obj = { a: 1, b: 2 };
|
2016-12-23 22:31:38 +03:00
|
|
|
loop1:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var prop1 in obj) {
|
2016-12-23 22:31:38 +03:00
|
|
|
loop2:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var prop2 in obj) {
|
2016-12-23 22:31:38 +03:00
|
|
|
break loop1;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function corge(x: boolean) {
|
|
|
|
for (var prop in {}) {
|
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2017-01-11 18:16:38 +03:00
|
|
|
}
|
|
|
|
"
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|
|
|
|
|
|
|
|
exports[`test abnormal_for_of.js 1`] = `
|
|
|
|
"function foo(x: boolean) {
|
|
|
|
var arr = [1, 2, 3];
|
|
|
|
for (var elem of arr) {
|
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bar(x: boolean) {
|
|
|
|
for (var elem of []) {
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function baz(x: boolean) {
|
|
|
|
for (var elem of []) {
|
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function bliffl(x: boolean) {
|
|
|
|
var arr = [1, 2, 3];
|
|
|
|
loop1: for (var elem of arr) {
|
|
|
|
loop2: for (var elem of arr) {
|
|
|
|
break loop1;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
function corge(x: boolean) {
|
|
|
|
for (var elem of []) {
|
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\'this is still reachable\');
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
function foo(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var arr = [ 1, 2, 3 ];
|
2016-12-23 22:31:38 +03:00
|
|
|
for (var elem of arr) {
|
|
|
|
if (x) {
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bar(x: boolean) {
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var elem of []) {
|
2016-12-23 22:31:38 +03:00
|
|
|
return;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function baz(x: boolean) {
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var elem of []) {
|
2016-12-23 22:31:38 +03:00
|
|
|
continue;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function bliffl(x: boolean) {
|
2016-12-28 05:40:04 +03:00
|
|
|
var arr = [ 1, 2, 3 ];
|
2016-12-23 22:31:38 +03:00
|
|
|
loop1:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var elem of arr) {
|
2016-12-23 22:31:38 +03:00
|
|
|
loop2:
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var elem of arr) {
|
2016-12-23 22:31:38 +03:00
|
|
|
break loop1;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2016-12-23 22:31:38 +03:00
|
|
|
}
|
2017-01-10 05:49:06 +03:00
|
|
|
|
2016-12-23 22:31:38 +03:00
|
|
|
function corge(x: boolean) {
|
2016-12-31 07:01:07 +03:00
|
|
|
for (var elem of []) {
|
2016-12-23 22:31:38 +03:00
|
|
|
break;
|
|
|
|
}
|
2016-12-30 19:56:42 +03:00
|
|
|
console.log(\"this is still reachable\");
|
2017-01-11 18:16:38 +03:00
|
|
|
}
|
|
|
|
"
|
2016-12-23 22:31:38 +03:00
|
|
|
`;
|