aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-03-11 15:54:43 +0800
committerGitHub <noreply@github.com>2018-03-11 15:54:43 +0800
commitb9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0 (patch)
tree7f4699b6e606a3e44a731083d1796c0ccc779056 /test/compress
parentfc6ebd04a59024dfd3b40b43825a007c62bac2b3 (diff)
downloadtracifyjs-b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0.tar.gz
tracifyjs-b9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0.zip
handle `case` correctly under `reduce_vars` (#2993)
fixes #2992
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/reduce_vars.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 836d7fe2..815dff32 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -5545,3 +5545,33 @@ issue_2919: {
}
expect_stdout: "function"
}
+
+issue_2992: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ }
+ input: {
+ var c = "PASS";
+ (function f(b) {
+ switch (0) {
+ case 0:
+ case b = 1:
+ b && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect: {
+ var c = "PASS";
+ (function f(b) {
+ switch (0) {
+ case 0:
+ case b = 1:
+ b && (c = "FAIL");
+ }
+ })();
+ console.log(c);
+ }
+ expect_stdout: "PASS"
+}