diff options
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/collapse_vars.js | 40 | ||||
-rw-r--r-- | test/compress/functions.js | 21 |
2 files changed, 61 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 17835a89..090f3cf8 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -6197,3 +6197,43 @@ Infinity_assignment: { } expect_stdout: true } + +issue_3439_1: { + options = { + collapse_vars: true, + unused: true, + } + input: { + console.log(typeof function(a) { + function a() {} + return a; + }(42)); + } + expect: { + console.log(typeof function(a) { + function a() {} + return a; + }(42)); + } + expect_stdout: "function" +} + +issue_3439_2: { + options = { + collapse_vars: true, + unused: true, + } + input: { + console.log(typeof function() { + var a = 42; + function a() {} + return a; + }()); + } + expect: { + console.log(typeof function() { + return 42; + }()); + } + expect_stdout: "number" +} diff --git a/test/compress/functions.js b/test/compress/functions.js index 40a38c02..f01a02e8 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -3149,6 +3149,27 @@ issue_3402: { ] } +issue_3439: { + options = { + inline: true, + } + input: { + console.log(typeof function() { + return function(a) { + function a() {} + return a; + }(42); + }()); + } + expect: { + console.log(typeof function(a) { + function a() {} + return a; + }(42)); + } + expect_stdout: "function" +} + issue_3444: { options = { inline: true, |