diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-08-21 01:05:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-21 08:05:10 +0800 |
commit | aa83ecdb3b1ab4c50cb8347b559e13c3dcf8b343 (patch) | |
tree | eca262c51319b60e7dfbd640ccf81cbc4d5a7744 /test | |
parent | a153176469d49b851b884b96261f01ea8026ba82 (diff) | |
download | tracifyjs-aa83ecdb3b1ab4c50cb8347b559e13c3dcf8b343.tar.gz tracifyjs-aa83ecdb3b1ab4c50cb8347b559e13c3dcf8b343.zip |
fix corner case in `switches` (#4060)
fixes #4059
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/switch.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/compress/switch.js b/test/compress/switch.js index 83bc40f5..e3f6859d 100644 --- a/test/compress/switch.js +++ b/test/compress/switch.js @@ -1150,3 +1150,34 @@ drop_switch_8: { (C !== D ? y : z)(); } } + +issue_4059: { + options = { + conditionals: true, + dead_code: true, + evaluate: true, + switches: true, + } + input: { + switch (0) { + default: + case 1: + break; + case a: + break; + var a; + } + console.log("PASS"); + } + expect: { + switch (0) { + default: + break; + case a: + break; + var a; + } + console.log("PASS"); + } + expect_stdout: "PASS" +} |