From a48f87abf2fb09cc8296444eb613021ef66492c3 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Mon, 30 Oct 2017 23:19:27 +0800 Subject: compress `new` `function` containing `this` (#2417) --- test/compress/properties.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'test/compress/properties.js') diff --git a/test/compress/properties.js b/test/compress/properties.js index 1b5e7fc7..ab202525 100644 --- a/test/compress/properties.js +++ b/test/compress/properties.js @@ -1006,3 +1006,22 @@ array_hole: { } expect_stdout: "2 undefined 3" } + +new_this: { + options = { + properties: true, + side_effects: true, + } + input: { + new { + f: function(a) { + this.a = a; + } + }.f(42); + } + expect: { + new function(a) { + this.a = a; + }(42); + } +} -- cgit v1.2.3