test262/test/language/expressions/object/method-definition/early-errors-object-method-duplicate-parameters.js Test: ({ async f(a, a) {} }); Expected: SyntaxError: duplicate parameter Actual: No Syntax error. Notes: - Applies to any method syntax, not just async (see below). - Chrome: SyntaxError: Duplicate parameter name not allowed in this context - Firefox: SyntaxError: duplicate argument names not allowed in this context - Edge: SyntaxError: Duplicate formal parameter names not allowed in this context Spec: https://tc39.github.io/ecma262/#sec-function-definitions-static-semantics-early-errors 14.1.2 Static Semantics: Early Errors > UniqueFormalParameters : FormalParameters > > It is a Syntax Error if BoundNames of FormalParameters contains any duplicate elements.
Created attachment 307920 [details] [PATCH] Proposed Fix
*** Bug 161408 has been marked as a duplicate of this bug. ***
This might be conflicting due to the other patches I have out for review. But I need to put up a new patch anyways to include addressing the FIXME + tests in 161408.
Yes, this adds a tiny change on top of the `yield` patch, so it should come after. Marked as blocking. I'll attach my patch so it doesn't get lost.
Created attachment 307923 [details] [PATCH] Proposed Fix
Comment on attachment 307923 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=307923&action=review r=me > JSTests/stress/async-await-syntax.js:143 > + testSyntaxError(`var outerObject = { async method(a, a) {} }`); > + testSyntaxError(`var outerObject = { async ['meth' + 'od'](a, a) {} }`); > + testSyntaxError(`var outerObject = { async 'method'(a, a) {} }`); > + testSyntaxError(`var outerObject = { async 0(a, a) {} }`); Can you also add some tests that use destructuring and the rest parameter? > LayoutTests/js/script-tests/parser-syntax-check.js:887 > +invalid("({ foo(a,a){} });"); > +invalid("({ foo(b, c, b){} });"); > +invalid("({ *foo(a,a){} });"); > +invalid("({ *foo(b, c, b){} });"); > +invalid("({ async foo(a,a){} });"); > +invalid("({ async foo(b, c, b){} });"); > +valid("({ foo: function(a,a){} });"); > +valid("({ foo: function(b, c, b){} });"); > +valid("({ foo: function*(a,a){} });"); > +valid("({ foo: function*(b, c, b){} });"); > +valid("({ foo: async function(a,a){} });"); > +valid("({ foo: async function(b, c, b){} });"); Can you also add some tests that use destructuring and the rest parameter?
Created attachment 308070 [details] [PATCH] For Landing
Comment on attachment 308070 [details] [PATCH] For Landing Clearing flags on attachment: 308070 Committed r215723: <http://trac.webkit.org/changeset/215723>