From f5952933a00bac8c9d794d5b0e3d5f8d6173c4a9 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 27 Mar 2017 02:32:46 +0800 Subject: preserve side effects in switch expression (#1694) fixes #1690 --- test/compress/switch.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'test/compress') 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" +} -- cgit v1.2.3