diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-11-09 00:53:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-09 00:53:15 +0800 |
commit | 5045e140b18485132b533c4ee52a18f97f3bf6f9 (patch) | |
tree | 9ba7c052a209165034e19999fa03705a87acf568 /test | |
parent | 10648c9af66364697f0f51219b0497fdfcb6dd34 (diff) | |
download | tracifyjs-5045e140b18485132b533c4ee52a18f97f3bf6f9.tar.gz tracifyjs-5045e140b18485132b533c4ee52a18f97f3bf6f9.zip |
fix corner case in `conditionals` (#3577)
fixes #3576
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/conditionals.js | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/conditionals.js b/test/compress/conditionals.js index 27536b9f..3e7a0927 100644 --- a/test/compress/conditionals.js +++ b/test/compress/conditionals.js @@ -1489,3 +1489,29 @@ angularjs_chain: { } } } + +issue_3576: { + options = { + conditionals: true, + evaluate: true, + pure_getters: "strict", + reduce_vars: true, + } + input: { + var c = "FAIL"; + (function(a) { + (a = -1) ? (a && (a.a = 0)) : (a && (a.a = 0)); + a && a[c = "PASS"]++; + })(); + console.log(c); + } + expect: { + var c = "FAIL"; + (function(a) { + a = -1, a, a.a = 0; + a, a[c = "PASS"]++; + })(); + console.log(c); + } + expect_stdout: "PASS" +} |