aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/compress/properties.js6
-rw-r--r--test/compress/side_effects.js17
-rw-r--r--test/input/issue-3294/output.js4
-rw-r--r--test/input/issue-520/output.js4
4 files changed, 22 insertions, 9 deletions
diff --git a/test/compress/properties.js b/test/compress/properties.js
index 169dcd11..43f08b42 100644
--- a/test/compress/properties.js
+++ b/test/compress/properties.js
@@ -1123,11 +1123,7 @@ new_this: {
}
}.f(42);
}
- expect: {
- new function(a) {
- this.a = a;
- }(42);
- }
+ expect: {}
}
issue_2513: {
diff --git a/test/compress/side_effects.js b/test/compress/side_effects.js
index 0746a56d..3c53dd25 100644
--- a/test/compress/side_effects.js
+++ b/test/compress/side_effects.js
@@ -416,3 +416,20 @@ issue_4008: {
"PASS",
]
}
+
+trim_new: {
+ options = {
+ side_effects: true,
+ }
+ input: {
+ new function(a) {
+ console.log(a);
+ }("PASS");
+ }
+ expect: {
+ (function(a) {
+ console.log(a);
+ })("PASS");
+ }
+ expect_stdout: "PASS"
+}
diff --git a/test/input/issue-3294/output.js b/test/input/issue-3294/output.js
index 33efadb6..2e847e1b 100644
--- a/test/input/issue-3294/output.js
+++ b/test/input/issue-3294/output.js
@@ -1,2 +1,2 @@
-new function(){console.log(3)};
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIEZvbyB7IGNvbnN0cnVjdG9yKCl7Y29uc29sZS5sb2coMSsyKTt9IH0gbmV3IEZvbygpO1xuIl0sIm5hbWVzIjpbImNvbnNvbGUiLCJsb2ciXSwibWFwcGluZ3MiOiJBQUErQyxJQUFyQyxXQUFnQkEsUUFBUUMsSUFBSSJ9
+console.log(3);
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIEZvbyB7IGNvbnN0cnVjdG9yKCl7Y29uc29sZS5sb2coMSsyKTt9IH0gbmV3IEZvbygpO1xuIl0sIm5hbWVzIjpbImNvbnNvbGUiLCJsb2ciXSwibWFwcGluZ3MiOiJBQUEwQkEsUUFBUUMsSUFBSSJ9
diff --git a/test/input/issue-520/output.js b/test/input/issue-520/output.js
index 33efadb6..2e847e1b 100644
--- a/test/input/issue-520/output.js
+++ b/test/input/issue-520/output.js
@@ -1,2 +1,2 @@
-new function(){console.log(3)};
-//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIEZvbyB7IGNvbnN0cnVjdG9yKCl7Y29uc29sZS5sb2coMSsyKTt9IH0gbmV3IEZvbygpO1xuIl0sIm5hbWVzIjpbImNvbnNvbGUiLCJsb2ciXSwibWFwcGluZ3MiOiJBQUErQyxJQUFyQyxXQUFnQkEsUUFBUUMsSUFBSSJ9
+console.log(3);
+//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN0ZGluIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIEZvbyB7IGNvbnN0cnVjdG9yKCl7Y29uc29sZS5sb2coMSsyKTt9IH0gbmV3IEZvbygpO1xuIl0sIm5hbWVzIjpbImNvbnNvbGUiLCJsb2ciXSwibWFwcGluZ3MiOiJBQUEwQkEsUUFBUUMsSUFBSSJ9