aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-06-15 13:59:53 +0100
committerGitHub <noreply@github.com>2021-06-15 20:59:53 +0800
commit21fc8f4630bccdb8b0a33747c2de8fd377e83138 (patch)
tree9d6785d39feaae5fa3adb43c0553bb3f4f66f334 /test/compress
parentbf76e357723daa4fc00004a10b2b3de82a2bf33e (diff)
downloadtracifyjs-21fc8f4630bccdb8b0a33747c2de8fd377e83138.tar.gz
tracifyjs-21fc8f4630bccdb8b0a33747c2de8fd377e83138.zip
fix corner case in `switches` (#5011)
fixes #5010
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/switches.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/switches.js b/test/compress/switches.js
index cbaa0644..af81b54c 100644
--- a/test/compress/switches.js
+++ b/test/compress/switches.js
@@ -1556,3 +1556,29 @@ issue_5008_4: {
}
expect_stdout: "PASS"
}
+
+issue_5010: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ switches: true,
+ }
+ input: {
+ var a;
+ switch (42) {
+ case console.log("PASS"):
+ case a:
+ console.log("FAIL");
+ case 42:
+ }
+ }
+ expect: {
+ var a;
+ switch (42) {
+ case console.log("PASS"):
+ case a:
+ console.log("FAIL");
+ }
+ }
+ expect_stdout: "PASS"
+}