diff options
Diffstat (limited to 'test/compress/arrows.js')
-rw-r--r-- | test/compress/arrows.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/compress/arrows.js b/test/compress/arrows.js index 6d9f89d1..57d8d395 100644 --- a/test/compress/arrows.js +++ b/test/compress/arrows.js @@ -434,6 +434,46 @@ collapse_value: { node_version: ">=4" } +collapse_property_lambda: { + options = { + collapse_vars: true, + pure_getters: "strict", + } + input: { + console.log(function f() { + f.g = () => 42; + return f.g(); + }()); + } + expect: { + console.log(function f() { + return (f.g = () => 42)(); + }()); + } + expect_stdout: "42" + node_version: ">=4" +} + +drop_return: { + options = { + side_effects: true, + } + input: { + (a => { + while (!console); + return console.log(a); + })(42); + } + expect: { + (a => { + while (!console); + console.log(a); + })(42); + } + expect_stdout: "42" + node_version: ">=4" +} + reduce_iife_1: { options = { evaluate: true, |