aboutsummaryrefslogtreecommitdiff
path: root/test/compress/properties.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-10-30 23:19:27 +0800
committerGitHub <noreply@github.com>2017-10-30 23:19:27 +0800
commita48f87abf2fb09cc8296444eb613021ef66492c3 (patch)
tree44baa58b8268f79548ed1e522b2019636176da0a /test/compress/properties.js
parent2fd927a7ccfb55de415bf1faafb45e5006ca9984 (diff)
downloadtracifyjs-a48f87abf2fb09cc8296444eb613021ef66492c3.tar.gz
tracifyjs-a48f87abf2fb09cc8296444eb613021ef66492c3.zip
compress `new` `function` containing `this` (#2417)
Diffstat (limited to 'test/compress/properties.js')
-rw-r--r--test/compress/properties.js19
1 files changed, 19 insertions, 0 deletions
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);
+ }
+}