fix corner case in side_effects (#3514)

fixes #3512
This commit is contained in:
Alex Lam S.L
2019-10-23 01:04:00 +08:00
committed by GitHub
parent 02308a7b56
commit a53ab99378
2 changed files with 31 additions and 1 deletions

View File

@@ -3340,3 +3340,33 @@ issue_3506_3: {
}
expect_stdout: "PASS"
}
issue_3512: {
options = {
collapse_vars: true,
pure_getters: "strict",
sequences: true,
side_effects: true,
unused: true,
}
input: {
var a = "PASS";
(function(b) {
(function() {
b <<= this || 1;
b.a = "FAIL";
})();
})();
console.log(a);
}
expect: {
var a = "PASS";
(function(b) {
(function() {
(b <<= this || 1).a = "FAIL";
})();
})(),
console.log(a);
}
expect_stdout: "PASS"
}