diff --git a/src/params/default/arrow-function.template b/src/params/default/arrow-function.template index 725c6cf187410c84e7143799c1fb1249e333223e..a18a7a4d9cec53a712d3320e9cf3a885cfcd6d7e 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 5d284d9bf876994fbd7fa6be4ca2b5d42b0967c8..621c63a70e2e54bc9de42eee2b075337c2058769 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 877f483ed0ee701eea9078133297f66c870a10c2..74a6b435691da813ad52bede9c07c83b5b79085b 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 248856e4404ababc6109de7921d91b3d9ad61fc7..a7a0de0b8564bcb61c0ecb00da5f20706d9abfb5 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 c115dec274f5869769ff264d7e4e836aadd54ebb..5cf5d5028ac1484b98c0360215a715f8d85a9a7e 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 b655b61f69d179191a4cbfa7da16543e0192b8c9..8e091631a206a9785794df9a5899a18149670c25 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 2bcd9a88263f2e6163d3fe5775d733f1ff76f7de..a9e7ef97eb931ed4761553a589ae42ec59ee37a9 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 370f93e0f34fb46976c08fde574b9acc6b853cde..66e512f15441ce6094ac341a20c1025b75e42902 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 5eb2f548e9e6dcd350e1014093d54ca9136f33f1..22b5497526b3d3451a0e05adca44573105a0686f 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 eca0735f2ca2d0c27334687c4b797aa59c059686..cfc4665a510967d12f0056f66d71405e7d687846 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 525930ab7d2d311638a0514a4a5d3900af732791..b440914323f91609b1adc22785ef6c8d07afa79f 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 e4a1818e7c9d37d22b898088c130e9a656ea70f2..af915ac22edee165b9ed04326df1d109ec6fe59f 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 303888c9b01ea04fe5941a4f18970b6098bb9a51..58cf39420853a8c3c19d2e36345f66d11e5066e5 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 5c40373b3bcfa42db168bea00a7413e1117e4ce1..5c9dcd38ee6a6ff7e4a9ac871abcf211101a9d08 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 aaea3c73f4f6576ef3a9707517d8fc99ae25b550..449da8e1a5c6fe12e713d0d2ba99509ce63ec16c 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 0000000000000000000000000000000000000000..7915023e6c0740407d87538f37a151105f0c61e2 --- /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 0000000000000000000000000000000000000000..c6f565ccff6d7ff950dbd711347a308e37225125 --- /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 0000000000000000000000000000000000000000..42bdf3f861fc720f6361dce26c977a6aee5147d7 --- /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 0000000000000000000000000000000000000000..defbc72dfd02a0faf8fc3c1aa9aa251022bff0a3 --- /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 135d14c9fcdd793d8f8ccb0535c4a8f63e876b15..0000000000000000000000000000000000000000 --- 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 4bb7b74a0fd0322a6511d35c8c1dfe73d673d945..0000000000000000000000000000000000000000 --- 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 6fa23cbefacd535ca3e330bfd5447a56cd73fdde..0000000000000000000000000000000000000000 --- 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 a9e84981e160b4ae5a4e4b71bfb5a269114186df..0000000000000000000000000000000000000000 --- 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 60ddc31393838095f14154ad4dbc7435632da093..0000000000000000000000000000000000000000 --- 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 5e5bfe70ae71ccd4ce64d6ec586be899ea134f09..0000000000000000000000000000000000000000 --- 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 7acec17f0cc28048a6c00ea53b3609f37333a2d4..0000000000000000000000000000000000000000 --- 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 8c62102420feb8cad49d0f07814caaabd9318cba..0000000000000000000000000000000000000000 --- 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 5ffb1a690e0cb10aff2c24813e36175d35dfebe6..0000000000000000000000000000000000000000 --- 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 028e7a36e5336681f04fd7ea0ec734b7ab82cd1d..0000000000000000000000000000000000000000 --- 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 97215097a23f51a4266a4cbac530429e008ef038..0000000000000000000000000000000000000000 --- 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 d295a468bbe8aeb36b430f705f7ab61d76dceb70..0000000000000000000000000000000000000000 --- 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 69781ecb65a138b10f3bb598d2e0d9ff56641662..0000000000000000000000000000000000000000 --- 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 e7ed1c671e9cc091de9a2e498cabd9d3442beb66..0000000000000000000000000000000000000000 --- 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 6878c4a6b182ec1b95080f48e574b6d4238037a6..0000000000000000000000000000000000000000 --- 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 679c2d4d582b40f74258d6870568820466acf984..0000000000000000000000000000000000000000 --- 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 2e932601fe5146aa8d5134bd0b2b7781773d5de4..0000000000000000000000000000000000000000 --- 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,) {}