diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-23 19:37:52 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-24 03:37:52 +0800 |
commit | acc443b2cf0614351aeb953e393260f13f783c96 (patch) | |
tree | 788ea95625b1a5c6972dad56a029b4b13d5b857c /test/compress | |
parent | f87e7be12c7857ec0fc772a9ea4db6d24b5e3551 (diff) | |
download | tracifyjs-acc443b2cf0614351aeb953e393260f13f783c96.tar.gz tracifyjs-acc443b2cf0614351aeb953e393260f13f783c96.zip |
fix corner case in `reduce_vars` (#4585)
fixes #4584
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/destructured.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 7cc6f46d..58fec606 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -2487,3 +2487,30 @@ issue_4554: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4584: { + options = { + evaluate: true, + reduce_vars: true, + } + input: { + try { + (function f({ + [console.log(a = "FAIL")]: a, + }) {})(0); + } catch (e) { + console.log("PASS"); + } + } + expect: { + try { + (function f({ + [console.log(a = "FAIL")]: a, + }) {})(0); + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=6" +} |