diff options
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/functions.js | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index 856dbcea..682b5844 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -5771,3 +5771,64 @@ new_target: { expect_stdout: "function undefined" node_version: ">=6" } + +issue_4753_1: { + options = { + inline: true, + toplevel: true, + } + input: { + for (var i in [ 1, 2 ]) + (function() { + function f() {} + f && console.log(f.p ^= 42); + })(); + } + expect: { + for (var i in [ 1, 2 ]) + f = function() {}, + void (f && console.log(f.p ^= 42)); + var f; + } + expect_stdout: [ + "42", + "42", + ] +} + +issue_4753_2: { + options = { + inline: true, + reduce_vars: true, + side_effects: true, + toplevel: true, + unused: true, + } + input: { + do { + (function() { + var a = f(); + function f() { + return "PASS"; + } + f; + function g() { + console.log(a); + } + g(); + })(); + } while (0); + } + expect: { + do { + f = function() { + return "PASS"; + }, + a = void 0, + a = f(), + console.log(a); + } while (0); + var f, a; + } + expect_stdout: "PASS" +} |