diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-07-02 04:28:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-02 04:28:11 +0800 |
commit | 8b69a3d18e38a63565dce1758dba79615b54cc79 (patch) | |
tree | 9c5d2fb15d19d5e53d6b690d263efd1c40dbcf3d /test | |
parent | d40950b741d67bafc91a102ce2c6e862af46fd11 (diff) | |
download | tracifyjs-8b69a3d18e38a63565dce1758dba79615b54cc79.tar.gz tracifyjs-8b69a3d18e38a63565dce1758dba79615b54cc79.zip |
drop argument value after `collapse_vars` (#2190)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/collapse_vars.js | 41 | ||||
-rw-r--r-- | test/compress/drop-unused.js | 2 |
2 files changed, 41 insertions, 2 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index f3eb7816..24f8ffa3 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -2187,7 +2187,7 @@ compound_assignment: { expect_stdout: "4" } -issue_2187: { +issue_2187_1: { options = { collapse_vars: true, unused: true, @@ -2217,3 +2217,42 @@ issue_2187: { "2", ] } + +issue_2187_2: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var b = 1; + console.log(function(a) { + return a && ++b; + }(b--)); + } + expect: { + var b = 1; + console.log(function(a) { + return b-- && ++b; + }()); + } + expect_stdout: "1" +} + +issue_2187_3: { + options = { + collapse_vars: true, + inline: true, + unused: true, + } + input: { + var b = 1; + console.log(function(a) { + return a && ++b; + }(b--)); + } + expect: { + var b = 1; + console.log(b-- && ++b); + } + expect_stdout: "1" +} diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index e1acdc10..a44107ae 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1113,7 +1113,7 @@ issue_2105: { options = { collapse_vars: true, inline: true, - passes: 2, + passes: 3, reduce_vars: true, side_effects: true, unused: true, |