simplify do-while into for (#2907)

fixes #2904
This commit is contained in:
Alex Lam S.L
2018-02-12 23:28:28 +08:00
committed by GitHub
parent 2088e1c19d
commit 0809699bdc
3 changed files with 27 additions and 9 deletions

View File

@@ -1178,9 +1178,7 @@ toplevel_on_loops_1: {
console.log("bar:", --x);
}
var x = 3;
do
bar();
while (x);
for (;bar(), x;);
}
expect_stdout: true
}
@@ -1208,9 +1206,7 @@ toplevel_off_loops_1: {
console.log("bar:", --x);
}
var x = 3;
do
bar();
while (x);
for (;bar(), x;);
}
expect_stdout: true
}
@@ -1265,9 +1261,7 @@ toplevel_off_loops_2: {
console.log("bar:");
}
var x = 3;
do
bar();
while (x);
for (;bar(), x;);
}
}