diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-03 20:30:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-04 03:30:10 +0800 |
commit | ffa19431773aec2205b4dfe7bbcc6d20e4e733fb (patch) | |
tree | bc849e35d72d9a318a7ecdfdffe1edf8c7dc7836 /test/compress/reduce_vars.js | |
parent | ac429dc8e1a3d49af8fd3627449bd22ffd781f20 (diff) | |
download | tracifyjs-ffa19431773aec2205b4dfe7bbcc6d20e4e733fb.tar.gz tracifyjs-ffa19431773aec2205b4dfe7bbcc6d20e4e733fb.zip |
fix corner case in `reduce_vars` (#3845)
fixes #3844
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r-- | test/compress/reduce_vars.js | 27 |
1 files changed, 27 insertions, 0 deletions
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" +} |