From ffa19431773aec2205b4dfe7bbcc6d20e4e733fb Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 3 May 2020 20:30:10 +0100 Subject: fix corner case in `reduce_vars` (#3845) fixes #3844 --- test/compress/reduce_vars.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'test/compress/reduce_vars.js') diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 6cc575f1..67d473dd 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -7006,3 +7006,30 @@ flatten_iife: { } expect_stdout: "PASS" } + +issue_3844: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + } + input: { + console.log(function() { + if (!console) switch (A = 0) { + case console.log("FAIL"): + return; + } + return typeof A; + }()); + } + expect: { + console.log(function() { + if (!console) switch (A = 0) { + case console.log("FAIL"): + return; + } + return typeof A; + }()); + } + expect_stdout: "undefined" +} -- cgit v1.2.3