diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/drop-unused.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index 0ac7bb33..e99d7ab1 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -1692,3 +1692,30 @@ issue_2768: { } expect_stdout: "PASS undefined" } + +issue_2846: { + options = { + collapse_vars: true, + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f(a, b) { + var a = 0; + b && b(a); + return a++; + } + var c = f(); + console.log(c); + } + expect: { + var c = function(a, b) { + a = 0; + b && b(a); + return a++; + }(); + console.log(c); + } + expect_stdout: "0" +} |