early-errors-object-method-duplicate-parameters.js (698B)
1 // |reftest| error:SyntaxError 2 // Copyright 2019 Mike Pennisi. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 esid: sec-method-definitions 7 description: Formal parameters may not contain duplicates 8 info: | 9 # 14.3 Method Definitions 10 11 MethodDefinition[Yield, Await]: 12 PropertyName[?Yield, ?Await](UniqueFormalParameters[~Yield, ~Await]){FunctionBody[~Yield, ~Await]} 13 14 # 14.1.2 Static Semantics: Early Errors 15 16 UniqueFormalParameters:FormalParameters 17 18 - It is a Syntax Error if BoundNames of FormalParameters contains any 19 duplicate elements. 20 negative: 21 phase: parse 22 type: SyntaxError 23 ---*/ 24 25 $DONOTEVALUATE(); 26 ({ 27 foo(a, a) { } 28 })