aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-04-01 17:19:57 +0800
committerGitHub <noreply@github.com>2017-04-01 17:19:57 +0800
commitee3fe0f4cd977213701579565ce68fc6a85916c3 (patch)
treebaf9def4449069bc166f3c1c3dbe204a3b39223c /test/compress
parent87f6e1b09146607a2bf1eaa080a645277c767dda (diff)
downloadtracifyjs-ee3fe0f4cd977213701579565ce68fc6a85916c3.tar.gz
tracifyjs-ee3fe0f4cd977213701579565ce68fc6a85916c3.zip
fix switch branch elimination (#1752)
Merge unreachable case body with previous fallthrough case fixes #1750
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/issue-1750.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/issue-1750.js b/test/compress/issue-1750.js
new file mode 100644
index 00000000..53a78e65
--- /dev/null
+++ b/test/compress/issue-1750.js
@@ -0,0 +1,25 @@
+case_1: {
+ options = {
+ dead_code: true,
+ evaluate: true,
+ }
+ input: {
+ var a = 0, b = 1;
+ switch (true) {
+ case a, true:
+ default:
+ b = 2;
+ case true:
+ }
+ console.log(a, b);
+ }
+ expect: {
+ var a = 0, b = 1;
+ switch (true) {
+ case a, true:
+ b = 2;
+ }
+ console.log(a, b);
+ }
+ expect_stdout: "0 2"
+}