aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAnthony Van de Gejuchte <anthonyvdgent@gmail.com>2016-06-10 15:42:55 +0200
committerRichard van Velzen <rvanvelzen@experty.com>2016-06-12 17:17:17 +0200
commit6c8e001feeeb957279814aa58be44d1ece8bdb6e (patch)
tree3524f33990522e8ef2dffb2e89fbea3d95e93193 /test/compress
parent9c53c7ada739ece69a9330811e5413a7da74a19b (diff)
downloadtracifyjs-6c8e001feeeb957279814aa58be44d1ece8bdb6e.tar.gz
tracifyjs-6c8e001feeeb957279814aa58be44d1ece8bdb6e.zip
Stop dropping args in new expressions
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/new.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/compress/new.js b/test/compress/new.js
index d956ae27..78a1026e 100644
--- a/test/compress/new.js
+++ b/test/compress/new.js
@@ -11,6 +11,30 @@ new_statement: {
expect_exact: "new x(1);new x(1)(2);new x(1)(2)(3);new new x(1);new new x(1)(2);new new x(1)(2);(new new x(1))(2);"
}
+new_statements_2: {
+ input: {
+ new x;
+ new new x;
+ new new new x;
+ new true;
+ new (0);
+ new (!0);
+ new (bar = function(foo) {this.foo=foo;})(123);
+ new (bar = function(foo) {this.foo=foo;})();
+ }
+ expect_exact: "new x;new(new x);new(new(new x));new true;new 0;new(!0);new(bar=function(foo){this.foo=foo})(123);new(bar=function(foo){this.foo=foo});"
+}
+
+new_statements_3: {
+ input: {
+ new (function(foo){this.foo=foo;})(1);
+ new (function(foo){this.foo=foo;})();
+ new (function test(foo){this.foo=foo;})(1);
+ new (function test(foo){this.foo=foo;})();
+ }
+ expect_exact: "new function(foo){this.foo=foo}(1);new function(foo){this.foo=foo};new function test(foo){this.foo=foo}(1);new function test(foo){this.foo=foo};"
+}
+
new_with_rewritten_true_value: {
options = { booleans: true }
input: {
@@ -18,3 +42,11 @@ new_with_rewritten_true_value: {
}
expect_exact: "new(!0);"
}
+
+new_with_many_parameters: {
+ input: {
+ new foo.bar("baz");
+ new x(/123/, 456);
+ }
+ expect_exact: 'new foo.bar("baz");new x(/123/,456);'
+}