From ee3fe0f4cd977213701579565ce68fc6a85916c3 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sat, 1 Apr 2017 17:19:57 +0800 Subject: fix switch branch elimination (#1752) Merge unreachable case body with previous fallthrough case fixes #1750 --- test/compress/issue-1750.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/compress/issue-1750.js (limited to 'test/compress/issue-1750.js') 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" +} -- cgit v1.2.3