diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-14 00:52:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-14 07:52:42 +0800 |
commit | 938368ba219f29703b9f9e67c6fb0d1c0723220a (patch) | |
tree | 6f0c4c03c96d35c7eb2cccf66d2e6685e70a8438 /test/compress/collapse_vars.js | |
parent | fe2f1965d6efcd1807eea087708ffdb9a5798db0 (diff) | |
download | tracifyjs-938368ba219f29703b9f9e67c6fb0d1c0723220a.tar.gz tracifyjs-938368ba219f29703b9f9e67c6fb0d1c0723220a.zip |
enhance `collapse_vars` (#3896)
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index dee370cf..0dd8754d 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -8015,3 +8015,38 @@ issue_3891: { } expect_stdout: "function" } + +issue_3894: { + options = { + collapse_vars: true, + inline: true, + reduce_vars: true, + unused: true, + } + input: { + function log(msg) { + console.log(msg ? "FAIL" : "PASS"); + } + var a, c; + (function(b) { + a = c = 0, + log(b); + })(-0); + log(a); + log(c); + } + expect: { + function log(msg) { + console.log(msg ? "FAIL" : "PASS"); + } + var a, c; + void log(-(a = c = 0)); + log(a); + log(c); + } + expect_stdout: [ + "PASS", + "PASS", + "PASS", + ] +} |