diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-16 18:06:00 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-17 02:06:00 +0800 |
commit | 42e34c870ad5979135ab7407ab62abce9507fc28 (patch) | |
tree | 2465b3c694049962454944d6d7d35aea7bb82805 /test/compress | |
parent | e390e7e12467ec1dd204245212aea9f811763439 (diff) | |
download | tracifyjs-42e34c870ad5979135ab7407ab62abce9507fc28.tar.gz tracifyjs-42e34c870ad5979135ab7407ab62abce9507fc28.zip |
fix corner case in `unused` (#4277)
fixes #4276
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/let.js | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/test/compress/let.js b/test/compress/let.js index 728e40b4..20bec4d3 100644 --- a/test/compress/let.js +++ b/test/compress/let.js @@ -1006,3 +1006,61 @@ issue_4274_2: { expect_stdout: "PASS" node_version: ">=4" } + +issue_4276_1: { + options = { + unused: true, + } + input: { + "use strict"; + try { + let a = b, b; + console.log("FAIL"); + } catch (e) { + console.log("PASS"); + } + } + expect: { + "use strict"; + try { + let a = b, b; + console.log("FAIL"); + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=4" +} + +issue_4276_2: { + options = { + unused: true, + } + input: { + "use strict"; + try { + let a = f(), b; + console.log("FAIL"); + function f() { + return b; + } + } catch (e) { + console.log("PASS"); + } + } + expect: { + "use strict"; + try { + let a = f(), b; + console.log("FAIL"); + function f() { + return b; + } + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=4" +} |