diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-17 06:43:04 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 14:43:04 +0800 |
commit | 2a612fd472b4d26fee4342fb57fe9ec54ab124cb (patch) | |
tree | b68b3debf36fc688407dc4fc9fa4b64e1ef8998f /test | |
parent | b9798a01a83269a6299d1f1e28d1e8f6d51b5726 (diff) | |
download | tracifyjs-2a612fd472b4d26fee4342fb57fe9ec54ab124cb.tar.gz tracifyjs-2a612fd472b4d26fee4342fb57fe9ec54ab124cb.zip |
fix corner case in `reduce_vars` (#4283)
fixes #4282
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 169bfb7d..65429b92 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -541,7 +541,7 @@ funarg_reduce_vars_3: { (function({ [a++]: b }) {})(0); - console.log(1); + console.log(a); } expect_stdout: "1" node_version: ">=6" @@ -1317,3 +1317,27 @@ issue_4280: { expect_stdout: "undefined" node_version: ">=6" } + +issue_4282: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + (function(a) { + ({ + [a = "bar"]: 0[console.log(a)], + } = 0); + })("foo"); + } + expect: { + (function(a) { + ({ + [a = "bar"]: 0[console.log(a)], + } = 0); + })("foo"); + } + expect_stdout: true + node_version: ">=6" +} |