diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-15 04:33:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-15 12:33:17 +0800 |
commit | 18dbceb36f02db6100c1588a77c18c6ca73f1baa (patch) | |
tree | d858ac813b5dc956156584954ac3496d52e5fb6b /test | |
parent | 65d39a3702643a8dc6a3b797a15470e6715d6f84 (diff) | |
download | tracifyjs-18dbceb36f02db6100c1588a77c18c6ca73f1baa.tar.gz tracifyjs-18dbceb36f02db6100c1588a77c18c6ca73f1baa.zip |
fix corner case in `unused` (#4557)
fixes #4556
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/spreads.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/compress/spreads.js b/test/compress/spreads.js index 1e4dcbf6..7c98fdcd 100644 --- a/test/compress/spreads.js +++ b/test/compress/spreads.js @@ -826,3 +826,23 @@ issue_4363: { expect_stdout: "PASS" node_version: ">=8" } + +issue_4556: { + options = { + reduce_vars: true, + unused: true, + } + input: { + console.log(function() { + var a = "" + [ a++ ]; + var b = [ ...a ]; + }()); + } + expect: { + console.log(function() { + var a; + }()); + } + expect_stdout: "undefined" + node_version: ">=6" +} |