fix corner case in collapse_vars (#3501)

This commit is contained in:
Alex Lam S.L
2019-10-20 03:53:20 +08:00
committed by GitHub
parent 543dd7d3d7
commit ca6dce43fe
2 changed files with 30 additions and 39 deletions

View File

@@ -6237,3 +6237,24 @@ issue_3439_2: {
}
expect_stdout: "number"
}
cond_sequence_return: {
options = {
collapse_vars: true,
}
input: {
console.log(function(n) {
var c = 0;
for (var k in [0, 1])
if (c++, k == n) return c;
}(1));
}
expect: {
console.log(function(n) {
var c = 0;
for (var k in [0, 1])
if (c++, k == n) return c;
}(1));
}
expect_stdout: "2"
}