diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-09-01 20:20:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-02 03:20:58 +0800 |
commit | da8d1545710add4cbe43901b41f56a1446a5eeb5 (patch) | |
tree | 539b9ae1ede35e6abd92a3358ab1cd8429ed0b87 /test/compress | |
parent | e33c727e8bf7687c827d3e88974ead18af263d12 (diff) | |
download | tracifyjs-da8d1545710add4cbe43901b41f56a1446a5eeb5.tar.gz tracifyjs-da8d1545710add4cbe43901b41f56a1446a5eeb5.zip |
fix corner case in `loops` & `unused` (#4085)
fixes #4084
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/loops.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js index e24b3712..878b77cb 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -1009,3 +1009,31 @@ issue_4082: { } expect_stdout: "PASS" } + +issue_4084: { + options = { + keep_fargs: "strict", + loops: true, + reduce_vars: true, + unused: true, + } + input: { + console.log(function() { + function f(a) { + var b = a++; + for (a in "foo"); + } + f(); + return typeof a; + }()); + } + expect: { + console.log(function() { + (function() { + 0; + })(); + return typeof a; + }()); + } + expect_stdout: "undefined" +} |