diff options
Diffstat (limited to 'test/compress')
-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 219adc9e..0b76f6f6 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -2965,3 +2965,30 @@ issue_4144: { } expect_stdout: "PASS" } + +issue_4146: { + options = { + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + function f(a, b) { + function g() {} + var a = g; + var c = b; + c.p; + console.log(typeof a); + } + f("FAIL", 42); + } + expect: { + (function(a, b) { + a = function () {}; + var c = b; + c.p; + console.log(typeof a); + })(0, 42); + } + expect_stdout: "function" +} |