diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-12-19 21:47:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-20 05:47:01 +0800 |
commit | 87cf7152135281a4b1a1163b26ea918a0a264f0b (patch) | |
tree | 41dd955905f0eebf5cd9f2f215bb26653cbb2a4e /test | |
parent | 2c9c72e06c674ae313001d0b5878fe2ccfc31492 (diff) | |
download | tracifyjs-87cf7152135281a4b1a1163b26ea918a0a264f0b.tar.gz tracifyjs-87cf7152135281a4b1a1163b26ea918a0a264f0b.zip |
fix corner case with destructuring `catch` (#4421)
fixes #4420
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 4c36e451..06c9fddb 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -1968,3 +1968,36 @@ issue_4399: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4420: { + options = { + unused: true, + } + input: { + console.log(function() { + var a = 1; + try { + throw [ "FAIL", "PASS" ]; + } catch ({ + [a]: b, + }) { + let a = 0; + return b; + } + }()); + } + expect: { + console.log(function() { + var a = 1; + try { + throw [ "FAIL", "PASS" ]; + } catch ({ + [a]: b, + }) { + return b; + } + }()); + } + expect_stdout: "PASS" + node_version: ">=8" +} |