fix corner case in reduce_vars (#3923)

fixes #3922
This commit is contained in:
Alex Lam S.L
2020-05-24 00:38:40 +01:00
committed by GitHub
parent d1cc5270a3
commit 2c4d7d66ef
2 changed files with 28 additions and 2 deletions

View File

@@ -7095,3 +7095,30 @@ issue_3894: {
}
expect_stdout: "PASS"
}
issue_3922: {
options = {
evaluate: true,
keep_fargs: "strict",
pure_getters: "strict",
reduce_vars: true,
side_effects: true,
unused: true,
}
input: {
(function(a) {
var b;
b && b[c];
a |= this;
console.log("PASS");
var c = a.undefined;
})();
}
expect: {
(function() {
0;
console.log("PASS");
})();
}
expect_stdout: "PASS"
}