From c37a2420570116eec7f5d829e9bc6b948557166a Mon Sep 17 00:00:00 2001 From: Leonardo Balter <leonardo.balter@gmail.com> Date: Tue, 14 Mar 2017 14:24:31 -0400 Subject: [PATCH] Move tests for params trailing comma to the test gen tool --- src/params/default/arrow-function.template | 7 ++--- .../default/cls-decl-gen-meth-static.template | 3 +++ src/params/default/cls-decl-gen-meth.template | 3 +++ .../default/cls-decl-meth-static.template | 3 +++ src/params/default/cls-decl-meth.template | 3 +++ .../default/cls-expr-gen-meth-static.template | 3 +++ src/params/default/cls-expr-gen-meth.template | 3 +++ .../default/cls-expr-meth-static.template | 3 +++ src/params/default/cls-expr-meth.template | 3 +++ src/params/default/func-decl.template | 5 ++-- src/params/default/func-expr.template | 7 ++--- src/params/default/gen-func-decl.template | 5 ++-- src/params/default/gen-func-expr.template | 7 ++--- src/params/default/gen-meth.template | 3 +++ src/params/default/meth.template | 3 +++ src/params/trailing-comma-dflt-param.case | 23 ++++++++++++++++ src/params/trailing-comma-multiple-param.case | 23 ++++++++++++++++ .../trailing-comma-rest-early-error.case | 24 +++++++++++++++++ src/params/trailing-comma-single-param.case | 22 ++++++++++++++++ .../params-trailing-comma-length.js | 21 --------------- .../arrow-function/params-trailing-comma.js | 9 ------- .../function/params-trailing-comma-length.js | 21 --------------- .../function/params-trailing-comma.js | 11 -------- .../params-trailing-comma-length.js | 21 --------------- .../generators/params-trailing-comma.js | 9 ------- .../params-trailing-comma-length.js | 26 ------------------- .../params-trailing-comma-rest.js | 15 ----------- .../params-trailing-comma.js | 11 -------- .../params-trailing-comma-rest.js | 14 ---------- .../params-trailing-comma-length.js | 26 ------------------- .../definition/params-trailing-comma-rest.js | 15 ----------- .../class/definition/params-trailing-comma.js | 11 -------- .../function/params-trailing-comma-length.js | 24 ----------------- .../function/params-trailing-comma.js | 9 ------- .../params-trailing-comma-length.js | 24 ----------------- .../generators/params-trailing-comma.js | 9 ------- 36 files changed, 140 insertions(+), 289 deletions(-) create mode 100644 src/params/trailing-comma-dflt-param.case create mode 100644 src/params/trailing-comma-multiple-param.case create mode 100644 src/params/trailing-comma-rest-early-error.case create mode 100644 src/params/trailing-comma-single-param.case delete mode 100644 test/language/expressions/arrow-function/params-trailing-comma-length.js delete mode 100644 test/language/expressions/arrow-function/params-trailing-comma.js delete mode 100644 test/language/expressions/function/params-trailing-comma-length.js delete mode 100644 test/language/expressions/function/params-trailing-comma.js delete mode 100644 test/language/expressions/generators/params-trailing-comma-length.js delete mode 100644 test/language/expressions/generators/params-trailing-comma.js delete mode 100644 test/language/expressions/object/method-definition/params-trailing-comma-length.js delete mode 100644 test/language/expressions/object/method-definition/params-trailing-comma-rest.js delete mode 100644 test/language/expressions/object/method-definition/params-trailing-comma.js delete mode 100644 test/language/rest-parameters/params-trailing-comma-rest.js delete mode 100644 test/language/statements/class/definition/params-trailing-comma-length.js delete mode 100644 test/language/statements/class/definition/params-trailing-comma-rest.js delete mode 100644 test/language/statements/class/definition/params-trailing-comma.js delete mode 100644 test/language/statements/function/params-trailing-comma-length.js delete mode 100644 test/language/statements/function/params-trailing-comma.js delete mode 100644 test/language/statements/generators/params-trailing-comma-length.js delete mode 100644 test/language/statements/generators/params-trailing-comma.js diff --git a/src/params/default/arrow-function.template b/src/params/default/arrow-function.template index 725c6cf187..a18a7a4d9c 100644 --- a/src/params/default/arrow-function.template +++ b/src/params/default/arrow-function.template @@ -38,11 +38,12 @@ info: | ---*/ var callCount = 0; -var f; -f = (/*{ params }*/) => { +// Stores a reference `ref` for case evaluation +var ref; +ref = (/*{ params }*/) => { /*{ body }*/ callCount = callCount + 1; }; -f(/*{ args }*/); +ref(/*{ args }*/); assert.sameValue(callCount, 1, 'arrow function invoked exactly once'); diff --git a/src/params/default/cls-decl-gen-meth-static.template b/src/params/default/cls-decl-gen-meth-static.template index 5d284d9bf8..621c63a70e 100644 --- a/src/params/default/cls-decl-gen-meth-static.template +++ b/src/params/default/cls-decl-gen-meth-static.template @@ -69,4 +69,7 @@ class C { C.method(/*{ args }*/).next(); +// Stores a reference `ref` for case evaluation +var ref = C.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-decl-gen-meth.template b/src/params/default/cls-decl-gen-meth.template index 877f483ed0..74a6b43569 100644 --- a/src/params/default/cls-decl-gen-meth.template +++ b/src/params/default/cls-decl-gen-meth.template @@ -69,4 +69,7 @@ class C { C.prototype.method(/*{ args }*/).next(); +// Stores a reference `ref` for case evaluation +var ref = C.prototype.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-decl-meth-static.template b/src/params/default/cls-decl-meth-static.template index 248856e440..a7a0de0b85 100644 --- a/src/params/default/cls-decl-meth-static.template +++ b/src/params/default/cls-decl-meth-static.template @@ -67,4 +67,7 @@ class C { C.method(/*{ args }*/); +// Stores a reference `ref` for case evaluation +var ref = C.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-decl-meth.template b/src/params/default/cls-decl-meth.template index c115dec274..5cf5d5028a 100644 --- a/src/params/default/cls-decl-meth.template +++ b/src/params/default/cls-decl-meth.template @@ -67,4 +67,7 @@ class C { C.prototype.method(/*{ args }*/); +// Stores a reference `ref` for case evaluation +var ref = C.prototype.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-expr-gen-meth-static.template b/src/params/default/cls-expr-gen-meth-static.template index b655b61f69..8e091631a2 100644 --- a/src/params/default/cls-expr-gen-meth-static.template +++ b/src/params/default/cls-expr-gen-meth-static.template @@ -71,4 +71,7 @@ var C = class { C.method(/*{ args }*/).next(); +// Stores a reference `ref` for case evaluation +var ref = C.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-expr-gen-meth.template b/src/params/default/cls-expr-gen-meth.template index 2bcd9a8826..a9e7ef97eb 100644 --- a/src/params/default/cls-expr-gen-meth.template +++ b/src/params/default/cls-expr-gen-meth.template @@ -71,4 +71,7 @@ var C = class { C.prototype.method(/*{ args }*/).next(); +// Stores a reference `ref` for case evaluation +var ref = C.prototype.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-expr-meth-static.template b/src/params/default/cls-expr-meth-static.template index 370f93e0f3..66e512f154 100644 --- a/src/params/default/cls-expr-meth-static.template +++ b/src/params/default/cls-expr-meth-static.template @@ -68,4 +68,7 @@ var C = class { C.method(/*{ args }*/); +// Stores a reference `ref` for case evaluation +var ref = C.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/cls-expr-meth.template b/src/params/default/cls-expr-meth.template index 5eb2f548e9..22b5497526 100644 --- a/src/params/default/cls-expr-meth.template +++ b/src/params/default/cls-expr-meth.template @@ -68,4 +68,7 @@ var C = class { C.prototype.method(/*{ args }*/); +// Stores a reference `ref` for case evaluation +var ref = C.prototype.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/default/func-decl.template b/src/params/default/func-decl.template index eca0735f2c..cfc4665a51 100644 --- a/src/params/default/func-decl.template +++ b/src/params/default/func-decl.template @@ -40,11 +40,12 @@ info: | ---*/ var callCount = 0; -function f(/*{ params }*/) { +// Stores a reference `ref` for case evaluation +function ref(/*{ params }*/) { /*{ body }*/ callCount = callCount + 1; } -f(/*{ args }*/); +ref(/*{ args }*/); assert.sameValue(callCount, 1, 'function invoked exactly once'); diff --git a/src/params/default/func-expr.template b/src/params/default/func-expr.template index 525930ab7d..b440914323 100644 --- a/src/params/default/func-expr.template +++ b/src/params/default/func-expr.template @@ -39,12 +39,13 @@ info: | ---*/ var callCount = 0; -var f; -f = function(/*{ params }*/) { +// Stores a reference `ref` for case evaluation +var ref; +ref = function(/*{ params }*/) { /*{ body }*/ callCount = callCount + 1; }; -f(/*{ args }*/); +ref(/*{ args }*/); assert.sameValue(callCount, 1, 'function invoked exactly once'); diff --git a/src/params/default/gen-func-decl.template b/src/params/default/gen-func-decl.template index e4a1818e7c..af915ac22e 100644 --- a/src/params/default/gen-func-decl.template +++ b/src/params/default/gen-func-decl.template @@ -39,11 +39,12 @@ info: | ---*/ var callCount = 0; -function* f(/*{ params }*/) { +// Stores a reference `ref` for case evaluation +function* ref(/*{ params }*/) { /*{ body }*/ callCount = callCount + 1; } -f(/*{ args }*/).next(); +ref(/*{ args }*/).next(); assert.sameValue(callCount, 1, 'generator function invoked exactly once'); diff --git a/src/params/default/gen-func-expr.template b/src/params/default/gen-func-expr.template index 303888c9b0..58cf394208 100644 --- a/src/params/default/gen-func-expr.template +++ b/src/params/default/gen-func-expr.template @@ -39,12 +39,13 @@ info: | ---*/ var callCount = 0; -var f; -f = function*(/*{ params }*/) { +// Stores a reference `ref` for case evaluation +var ref; +ref = function*(/*{ params }*/) { /*{ body }*/ callCount = callCount + 1; }; -f(/*{ args }*/).next(); +ref(/*{ args }*/).next(); assert.sameValue(callCount, 1, 'generator function invoked exactly once'); diff --git a/src/params/default/gen-meth.template b/src/params/default/gen-meth.template index 5c40373b3b..5c9dcd38ee 100644 --- a/src/params/default/gen-meth.template +++ b/src/params/default/gen-meth.template @@ -53,4 +53,7 @@ var obj = { obj.method(/*{ args }*/).next(); +// Stores a reference `ref` for case evaluation +var ref = obj.method; + assert.sameValue(callCount, 1, 'generator method invoked exactly once'); diff --git a/src/params/default/meth.template b/src/params/default/meth.template index aaea3c73f4..449da8e1a5 100644 --- a/src/params/default/meth.template +++ b/src/params/default/meth.template @@ -50,4 +50,7 @@ var obj = { obj.method(/*{ args }*/); +// Stores a reference `ref` for case evaluation +var ref = obj.method; + assert.sameValue(callCount, 1, 'method invoked exactly once'); diff --git a/src/params/trailing-comma-dflt-param.case b/src/params/trailing-comma-dflt-param.case new file mode 100644 index 0000000000..7915023e6c --- /dev/null +++ b/src/params/trailing-comma-dflt-param.case @@ -0,0 +1,23 @@ +// Copyright (C) 2016 Jeff Morrison. All rights reserved. +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: A trailing comma should not increase the respective length, using default parameters +template: default +info: | + Trailing comma in the parameters list + + 14.1 Function Definitions + + FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , +---*/ + +//- params +a, b = 39, +//- args +42, undefined, 1 +//- body +assert.sameValue(a, 42); +assert.sameValue(b, 39); +//- teardown +assert.sameValue(ref.length, 1, 'length is properly set'); diff --git a/src/params/trailing-comma-multiple-param.case b/src/params/trailing-comma-multiple-param.case new file mode 100644 index 0000000000..c6f565ccff --- /dev/null +++ b/src/params/trailing-comma-multiple-param.case @@ -0,0 +1,23 @@ +// Copyright (C) 2016 Jeff Morrison. All rights reserved. +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: A trailing comma should not increase the respective length, using multiple parameters +template: default +info: | + Trailing comma in the parameters list + + 14.1 Function Definitions + + FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , +---*/ + +//- params +a, b, +//- args +42, 39, 1 +//- body +assert.sameValue(a, 42); +assert.sameValue(b, 39); +//- teardown +assert.sameValue(ref.length, 2, 'length is properly set'); diff --git a/src/params/trailing-comma-rest-early-error.case b/src/params/trailing-comma-rest-early-error.case new file mode 100644 index 0000000000..42bdf3f861 --- /dev/null +++ b/src/params/trailing-comma-rest-early-error.case @@ -0,0 +1,24 @@ +// Copyright (C) 2016 Jeff Morrison. All rights reserved. +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: It's a syntax error if a FunctionRestParameter is followed by a trailing comma +template: syntax +negative: + phase: early + type: SyntaxError +info: | + Trailing comma in the parameters list + + 14.1 Function Definitions + + FormalParameters[Yield, Await] : + [empty] + FunctionRestParameter[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] + FormalParameterList[?Yield, ?Await] , + FormalParameterList[?Yield, ?Await] , FunctionRestParameter[?Yield, ?Await] +---*/ + +//- params +...a, diff --git a/src/params/trailing-comma-single-param.case b/src/params/trailing-comma-single-param.case new file mode 100644 index 0000000000..defbc72dfd --- /dev/null +++ b/src/params/trailing-comma-single-param.case @@ -0,0 +1,22 @@ +// Copyright (C) 2016 Jeff Morrison. All rights reserved. +// Copyright (C) 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: A trailing comma should not increase the respective length, using a single parameter +template: default +info: | + Trailing comma in the parameters list + + 14.1 Function Definitions + + FormalParameters[Yield, Await] : FormalParameterList[?Yield, ?Await] , +---*/ + +//- params +a, +//- args +42, 39 +//- body +assert.sameValue(a, 42); +//- teardown +assert.sameValue(ref.length, 1, 'length is properly set'); diff --git a/test/language/expressions/arrow-function/params-trailing-comma-length.js b/test/language/expressions/arrow-function/params-trailing-comma-length.js deleted file mode 100644 index 135d14c9fc..0000000000 --- a/test/language/expressions/arrow-function/params-trailing-comma-length.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of arrow - functions. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -assert.sameValue( - ((a,) => {}).length, - 1, - "Arrow function with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - ((a,b,) => {}).length, - 2, - "Arrow function with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/expressions/arrow-function/params-trailing-comma.js b/test/language/expressions/arrow-function/params-trailing-comma.js deleted file mode 100644 index 4bb7b74a0f..0000000000 --- a/test/language/expressions/arrow-function/params-trailing-comma.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in arrow function argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -((a,) => {}); -((a,b,) => {}); diff --git a/test/language/expressions/function/params-trailing-comma-length.js b/test/language/expressions/function/params-trailing-comma-length.js deleted file mode 100644 index 6fa23cbefa..0000000000 --- a/test/language/expressions/function/params-trailing-comma-length.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of - function expressions. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -assert.sameValue( - (function(a,) {}).length, - 1, - "Function expression with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - (function(a,b,) {}).length, - 2, - "Function expression with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/expressions/function/params-trailing-comma.js b/test/language/expressions/function/params-trailing-comma.js deleted file mode 100644 index a9e84981e1..0000000000 --- a/test/language/expressions/function/params-trailing-comma.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas are permitted in function expression - argument lists. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -var one = (0, function(a,) {}); -var two = (0, function(a,b,) {}); diff --git a/test/language/expressions/generators/params-trailing-comma-length.js b/test/language/expressions/generators/params-trailing-comma-length.js deleted file mode 100644 index 60ddc31393..0000000000 --- a/test/language/expressions/generators/params-trailing-comma-length.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of generator - function expressions. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -assert.sameValue( - (function*(a,) {}).length, - 1, - "Generator expression with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - (function*(a,b,) {}).length, - 2, - "Generator expression with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/expressions/generators/params-trailing-comma.js b/test/language/expressions/generators/params-trailing-comma.js deleted file mode 100644 index 5e5bfe70ae..0000000000 --- a/test/language/expressions/generators/params-trailing-comma.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in generator function argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -var one = (0, function*(a,) {}); -var two = (0, function*(a,b,) {}); diff --git a/test/language/expressions/object/method-definition/params-trailing-comma-length.js b/test/language/expressions/object/method-definition/params-trailing-comma-length.js deleted file mode 100644 index 7acec17f0c..0000000000 --- a/test/language/expressions/object/method-definition/params-trailing-comma-length.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of - object methods. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -var obj = { - one(a,) {}, - two(a,b,) {}, -}; - -assert.sameValue( - obj.one.length, - 1, - "Object method with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - obj.two.length, - 2, - "Object method with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/expressions/object/method-definition/params-trailing-comma-rest.js b/test/language/expressions/object/method-definition/params-trailing-comma-rest.js deleted file mode 100644 index 8c62102420..0000000000 --- a/test/language/expressions/object/method-definition/params-trailing-comma-rest.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas are not permitted after rest params in - object method parameter lists. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> -negative: - phase: early - type: SyntaxError ----*/ -({ - m(...[],) {} -}); diff --git a/test/language/expressions/object/method-definition/params-trailing-comma.js b/test/language/expressions/object/method-definition/params-trailing-comma.js deleted file mode 100644 index 5ffb1a690e..0000000000 --- a/test/language/expressions/object/method-definition/params-trailing-comma.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in object method argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -({ - one(a,) {}, - two(a,b,) {}, -}); diff --git a/test/language/rest-parameters/params-trailing-comma-rest.js b/test/language/rest-parameters/params-trailing-comma-rest.js deleted file mode 100644 index 028e7a36e5..0000000000 --- a/test/language/rest-parameters/params-trailing-comma-rest.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas are not permitted permitted after rest - arguments in arrow function argument lists. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> -negative: - phase: early - type: SyntaxError ----*/ - -((...a,) => {}) diff --git a/test/language/statements/class/definition/params-trailing-comma-length.js b/test/language/statements/class/definition/params-trailing-comma-length.js deleted file mode 100644 index 97215097a2..0000000000 --- a/test/language/statements/class/definition/params-trailing-comma-length.js +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of - class methods. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -class C { - one(a,) {} - two(a,b,) {} -}; - -assert.sameValue( - C.prototype.one.length, - 1, - "Class method with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - C.prototype.two.length, - 2, - "Class method with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/statements/class/definition/params-trailing-comma-rest.js b/test/language/statements/class/definition/params-trailing-comma-rest.js deleted file mode 100644 index d295a468bb..0000000000 --- a/test/language/statements/class/definition/params-trailing-comma-rest.js +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas are not permitted after rest args in - class method parameter lists. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> -negative: - phase: early - type: SyntaxError ----*/ -class C { - m(...[],) {} -} diff --git a/test/language/statements/class/definition/params-trailing-comma.js b/test/language/statements/class/definition/params-trailing-comma.js deleted file mode 100644 index 69781ecb65..0000000000 --- a/test/language/statements/class/definition/params-trailing-comma.js +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in class method argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -class C { - one(a,) {} - two(a,b,) {} -} diff --git a/test/language/statements/function/params-trailing-comma-length.js b/test/language/statements/function/params-trailing-comma-length.js deleted file mode 100644 index e7ed1c671e..0000000000 --- a/test/language/statements/function/params-trailing-comma-length.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of - function declarations. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -function one(a,) {} -function two(a,b,) {} - -assert.sameValue( - one.length, - 1, - "Function expression with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - two.length, - 2, - "Function expression with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/statements/function/params-trailing-comma.js b/test/language/statements/function/params-trailing-comma.js deleted file mode 100644 index 6878c4a6b1..0000000000 --- a/test/language/statements/function/params-trailing-comma.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in function declaration argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -function one(a,) {} -function two(a,b,) {} diff --git a/test/language/statements/generators/params-trailing-comma-length.js b/test/language/statements/generators/params-trailing-comma-length.js deleted file mode 100644 index 679c2d4d58..0000000000 --- a/test/language/statements/generators/params-trailing-comma-length.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: > - Check that trailing commas don't affect the .length property of - generator function declarations. -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ - -function* one(a,) {} -function* two(a,b,) {} - -assert.sameValue( - one.length, - 1, - "Function expression with 1 arg + trailing comma reports incorrect .length!" -); - -assert.sameValue( - two.length, - 2, - "Function expression with 2 args + trailing comma reports incorrect .length!" -); diff --git a/test/language/statements/generators/params-trailing-comma.js b/test/language/statements/generators/params-trailing-comma.js deleted file mode 100644 index 2e932601fe..0000000000 --- a/test/language/statements/generators/params-trailing-comma.js +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (C) 2016 Jeff Morrison. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. -/*--- -description: Check that trailing commas are permitted in generator function argument lists -info: http://jeffmo.github.io/es-trailing-function-commas/ -author: Jeff Morrison <lbljeffmo@gmail.com> ----*/ -function* one(a,) {} -function* two(a,b,) {} -- GitLab