diff options
author | Anthony Van de Gejuchte <anthonyvdgent@gmail.com> | 2016-06-10 15:42:55 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen@experty.com> | 2016-06-12 17:17:17 +0200 |
commit | 6c8e001feeeb957279814aa58be44d1ece8bdb6e (patch) | |
tree | 3524f33990522e8ef2dffb2e89fbea3d95e93193 /test/mocha/new.js | |
parent | 9c53c7ada739ece69a9330811e5413a7da74a19b (diff) | |
download | tracifyjs-6c8e001feeeb957279814aa58be44d1ece8bdb6e.tar.gz tracifyjs-6c8e001feeeb957279814aa58be44d1ece8bdb6e.zip |
Stop dropping args in new expressions
Diffstat (limited to 'test/mocha/new.js')
-rw-r--r-- | test/mocha/new.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/mocha/new.js b/test/mocha/new.js index 7e7aea7d..8c0f24bc 100644 --- a/test/mocha/new.js +++ b/test/mocha/new.js @@ -5,19 +5,31 @@ describe("New", function() { it("Should attach callback parens after some tokens", function() { var tests = [ "new x(1);", + "new x;", + "new new x;", "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 true;", "new (0);", "new (!0);", - "new (bar = function(foo) {this.foo=foo;})(123);" + "new (bar = function(foo) {this.foo=foo;})(123);", + "new (bar = function(foo) {this.foo=foo;})();" ]; var expected = [ "new x(1);", + "new x;", + "new (new x);", "new function(foo) {\n this.foo = foo;\n}(1);", + "new function(foo) {\n this.foo = foo;\n};", + "new function test(foo) {\n this.foo = foo;\n}(1);", + "new function test(foo) {\n this.foo = foo;\n};", "new true;", "new 0;", "new (!0);", - "new (bar = function(foo) {\n this.foo = foo;\n})(123);" + "new (bar = function(foo) {\n this.foo = foo;\n})(123);", + "new (bar = function(foo) {\n this.foo = foo;\n});" ]; for (var i = 0; i < tests.length; i++) { assert.strictEqual( |