diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-19 22:23:37 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-20 06:23:37 +0800 |
commit | 1b579779be52116a029622156c0217ef33b95f86 (patch) | |
tree | d2a1fb5ae56b9e93a629ca38c1c4a95a23f11b46 /test | |
parent | b18b70f63bce53f1e19ad53c35cef6860b736ea6 (diff) | |
download | tracifyjs-1b579779be52116a029622156c0217ef33b95f86.tar.gz tracifyjs-1b579779be52116a029622156c0217ef33b95f86.zip |
fix corner case in `collapse_vars` (#4309)
fixes #4308
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index bbe62a71..f8e8090d 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1591,3 +1591,28 @@ issue_4301: { expect_stdout: true node_version: ">=6" } + +issue_4308: { + options = { + collapse_vars: true, + unused: true, + } + input: { + var a = "PASS"; + console.log(function({ + [a = "FAIL"]: b + }, c) { + return c; + }(0, a)); + } + expect: { + var a = "PASS"; + console.log(function({ + [a = "FAIL"]: b + }, c) { + return c; + }(0, a)); + } + expect_stdout: "PASS" + node_version: ">=6" +} |