aboutsummaryrefslogtreecommitdiff
path: root/test/compress/switch.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-03-27 02:32:46 +0800
committerGitHub <noreply@github.com>2017-03-27 02:32:46 +0800
commitf5952933a00bac8c9d794d5b0e3d5f8d6173c4a9 (patch)
tree167c83c5e7084d722738be5b1dc47bc7e15d7fe2 /test/compress/switch.js
parentf001e4cb9d5bfe56e25db552bb7ab0951a142a99 (diff)
downloadtracifyjs-f5952933a00bac8c9d794d5b0e3d5f8d6173c4a9.tar.gz
tracifyjs-f5952933a00bac8c9d794d5b0e3d5f8d6173c4a9.zip
preserve side effects in switch expression (#1694)
fixes #1690
Diffstat (limited to 'test/compress/switch.js')
-rw-r--r--test/compress/switch.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/switch.js b/test/compress/switch.js
index 2025d91b..654a838b 100644
--- a/test/compress/switch.js
+++ b/test/compress/switch.js
@@ -553,3 +553,29 @@ issue_1680_2: {
}
expect_stdout: true
}
+
+issue_1690_1: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ switch (console.log("PASS")) {}
+ }
+ expect: {
+ console.log("PASS");
+ }
+ expect_stdout: "PASS"
+}
+
+issue_1690_2: {
+ options = {
+ dead_code: false,
+ }
+ input: {
+ switch (console.log("PASS")) {}
+ }
+ expect: {
+ switch (console.log("PASS")) {}
+ }
+ expect_stdout: "PASS"
+}