diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/reduce_vars.js | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 734ce4ed..a5ab59f9 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -1252,3 +1252,78 @@ iife_func_side_effects: { })(x(), 0, z()); } } + +issue_1595_1: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + (function f(a) { + return f(a + 1); + })(2); + } + expect: { + (function f(a) { + return f(a + 1); + })(2); + } +} + +issue_1595_2: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + (function f(a) { + return g(a + 1); + })(2); + } + expect: { + (function(a) { + return g(a + 1); + })(2); + } +} + +issue_1595_3: { + options = { + evaluate: true, + passes: 2, + reduce_vars: true, + unused: true, + } + input: { + (function f(a) { + return g(a + 1); + })(2); + } + expect: { + (function(a) { + return g(3); + })(); + } +} + +issue_1595_4: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + (function iife(a, b, c) { + console.log(a, b, c); + if (a) iife(a - 1, b, c); + })(3, 4, 5); + } + expect: { + (function iife(a, b, c) { + console.log(a, b, c); + if (a) iife(a - 1, b, c); + })(3, 4, 5); + } +} |