diff options
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/classes.js | 19 | ||||
-rw-r--r-- | test/compress/functions.js | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/test/compress/classes.js b/test/compress/classes.js index 93819bfa..a1b4f0cd 100644 --- a/test/compress/classes.js +++ b/test/compress/classes.js @@ -1225,3 +1225,22 @@ issue_4725_2: { expect_stdout: "PASS" node_version: ">=4" } + +new_target: { + input: { + console.log(typeof new class { + constructor() { + this.f = () => new.target; + } + }().f()); + } + expect: { + console.log(typeof new class { + constructor() { + this.f = () => new.target; + } + }().f()); + } + expect_stdout: "function" + node_version: ">=6" +} diff --git a/test/compress/functions.js b/test/compress/functions.js index 30779c15..856dbcea 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -5752,3 +5752,22 @@ issue_4725_2: { expect_stdout: "PASS" node_version: ">=4" } + +new_target: { + input: { + console.log(typeof new function() { + return new.target; + }, function() { + return new.target; + }()); + } + expect: { + console.log(typeof new function() { + return new.target; + }(), function() { + return new.target; + }()); + } + expect_stdout: "function undefined" + node_version: ">=6" +} |