reset argument value within loop after inline (#2699)

This commit is contained in:
Alex Lam S.L
2018-01-02 01:24:53 +08:00
committed by GitHub
parent 2f3bddbaca
commit d838b4b52e
2 changed files with 29 additions and 5 deletions

View File

@@ -1671,3 +1671,26 @@ duplicate_argnames: {
}
expect_stdout: "PASS"
}
loop_init_arg: {
options = {
inline: true,
side_effects: true,
toplevel: true,
}
input: {
var a = "PASS";
for (var k in "12") (function (b) {
(b >>= 1) && (a = "FAIL"), b = 2;
})();
console.log(a);
}
expect: {
var a = "PASS";
for (var k in "12")
b = void 0, (b >>= 1) && (a = "FAIL"), b = 2;
var b;
console.log(a);
}
expect_stdout: "PASS"
}