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

@@ -605,3 +605,20 @@ issue_2740_5: {
}
expect_stdout: "0 undefined"
}
issue_2904: {
options = {
join_vars: true,
loops: true,
}
input: {
var a = 1;
do {
console.log(a);
} while (--a);
}
expect: {
for (var a = 1; console.log(a), --a;);
}
expect_stdout: "1"
}