fix corner case in assignments (#3376)

fixes #3375
This commit is contained in:
Alex Lam S.L
2019-04-24 02:50:15 +08:00
committed by GitHub
parent f01cc1e413
commit a84beafd1b
4 changed files with 56 additions and 9 deletions

View File

@@ -2005,3 +2005,24 @@ issue_3233: {
}
expect_stdout: "PASS"
}
issue_3375: {
options = {
reduce_vars: true,
toplevel: true,
unused: true,
}
input: {
var b = 1;
var a = c = [], c = --b + ("function" == typeof f && f());
var a = c && c[a];
console.log(a, b);
}
expect: {
var b = 1;
var a = [], c = --b + ("function" == typeof f && f());
a = c && c[a];
console.log(a, b);
}
expect_stdout: "0 0"
}