diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-05-28 13:07:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-28 20:07:36 +0800 |
commit | d47ea77811c5b5935578e29203db99739683f5f5 (patch) | |
tree | 5b5fd796ddf8b54f765e731c9446cefacad88063 /test/compress/functions.js | |
parent | 7840746bd95c965409ba7e6dbbd291a88ed64f83 (diff) | |
download | tracifyjs-d47ea77811c5b5935578e29203db99739683f5f5.tar.gz tracifyjs-d47ea77811c5b5935578e29203db99739683f5f5.zip |
fix corner case in `functions` (#3930)
fixes #3929
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r-- | test/compress/functions.js | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 7ad6ff03..9607c593 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -4705,3 +4705,44 @@ issue_3911: { } expect_stdout: "PASS" } + +issue_3929: { + options = { + functions: true, + reduce_vars: true, + unused: true, + } + input: { + (function() { + var abc = function f() { + (function() { + switch (f) { + default: + var abc = 0; + case 0: + abc.p; + } + console.log(typeof f); + })(); + }; + typeof abc && abc(); + })(); + } + expect: { + (function() { + var abc = function f() { + (function() { + switch (f) { + default: + var abc = 0; + case 0: + abc.p; + } + console.log(typeof f); + })(); + }; + typeof abc && abc(); + })(); + } + expect_stdout: "function" +} |