diff options
Diffstat (limited to 'test/compress/yields.js')
-rw-r--r-- | test/compress/yields.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/yields.js b/test/compress/yields.js index cd2518d6..7ba19bfd 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -667,6 +667,44 @@ inline_nested_yield: { node_version: ">=4" } +drop_body: { + options = { + side_effects: true, + yields: true, + } + input: { + (function*([ , a = console.log("foo") ]) { + console.log("bar"); + })([ console.log("baz") ]); + } + expect: { + [ [ , 0[0] = console.log("foo") ] ] = [ [ console.log("baz") ] ]; + } + expect_stdout: [ + "baz", + "foo", + ] + node_version: ">=6" +} + +drop_unused_call: { + options = { + inline: true, + side_effects: true, + toplevel: true, + unused: true, + yields: true, + } + input: { + var a = function*(){}(console.log("PASS")); + } + expect: { + console.log("PASS"); + } + expect_stdout: "PASS" + node_version: ">=4" +} + issue_4454_1: { rename = false options = { |