diff options
Diffstat (limited to 'test/compress/default-values.js')
-rw-r--r-- | test/compress/default-values.js | 57 |
1 files changed, 56 insertions, 1 deletions
diff --git a/test/compress/default-values.js b/test/compress/default-values.js index 7308b303..0fa27ea5 100644 --- a/test/compress/default-values.js +++ b/test/compress/default-values.js @@ -354,6 +354,22 @@ inline_constant: { node_version: ">=6" } +inline_destructured: { + options = { + inline: true, + } + input: { + console.log(function([ a ] = []) { + return "PASS"; + }()); + } + expect: { + console.log(([ [] = [] ] = [], "PASS")); + } + expect_stdout: "PASS" + node_version: ">=6" +} + inline_function: { options = { default_values: true, @@ -423,6 +439,45 @@ inline_loop_2: { node_version: ">=6" } +inline_side_effects_1: { + options = { + inline: true, + toplevel: true, + } + input: { + var a = 42; + (function(b = --a) {})(console); + console.log(a); + } + expect: { + var a = 42; + [ b = --a ] = [ console ], + void 0; + var b; + console.log(a); + } + expect_stdout: "42" + node_version: ">=6" +} + +inline_side_effects_2: { + options = { + side_effects: true, + } + input: { + var a = 42; + (function(b = --a) {})(console); + console.log(a); + } + expect: { + var a = 42; + [ 0[0] = --a ] = [ console ]; + console.log(a); + } + expect_stdout: "42" + node_version: ">=6" +} + drop_empty_iife: { options = { side_effects: true, @@ -1419,7 +1474,7 @@ issue_4502_4: { (function(a, b = console.log("FAIL")) {})(..."" + console.log(42)); } expect: { - (function(a, b = console.log("FAIL")) {})(..."" + console.log(42)); + [ , 0[0] = console.log("FAIL") ] = [ ..."" + console.log(42) ]; } expect_stdout: "42" node_version: ">=6" |