fix dead_code on for (#2552)

This commit is contained in:
Alex Lam S.L
2017-12-02 15:46:05 +08:00
committed by GitHub
parent 85c56adbd1
commit 77332a0315
2 changed files with 27 additions and 3 deletions

View File

@@ -468,3 +468,27 @@ init_side_effects: {
}
expect_stdout: true
}
dead_code_condition: {
options = {
dead_code: true,
evaluate: true,
loops: true,
sequences: true,
}
input: {
for (var a = 0, b = 5; (a += 1, 3) - 3 && b > 0; b--) {
var c = function() {
b--;
}(a++);
}
console.log(a);
}
expect: {
var c;
var a = 0, b = 5;
a += 1, 0,
console.log(a);
}
expect_stdout: "1"
}