fix corner case in collapse_vars (#3642)

fixes #3641
This commit is contained in:
Alex Lam S.L
2019-12-22 01:08:56 +00:00
committed by GitHub
parent 3ff0feddee
commit 519a00bd8a
2 changed files with 27 additions and 1 deletions

View File

@@ -7399,3 +7399,26 @@ issue_3628_2: {
}
expect_stdout: "foo bar"
}
issue_3641: {
options = {
collapse_vars: true,
}
input: {
var a, b;
try {
a = "foo";
b = (a += (A.p = 0, "bar")) % 0;
} catch (e) {}
console.log(a, b);
}
expect: {
var a, b;
try {
a = "foo";
b = (a += (A.p = 0, "bar")) % 0;
} catch (e) {}
console.log(a, b);
}
expect_stdout: "foo undefined"
}