params-duplicate.js (888B)
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-arrow-function-definitions 7 description: Formal parameters may not contain duplicates 8 info: | 9 # 14.2 Arrow Function Definitions 10 11 When the production 12 13 ArrowParameters:CoverParenthesizedExpressionAndArrowParameterList 14 15 is recognized the following grammar is used to refine the interpretation 16 of CoverParenthesizedExpressionAndArrowParameterList: 17 18 ArrowFormalParameters[Yield, Await]: 19 (UniqueFormalParameters[?Yield, ?Await]) 20 21 # 14.1.2 Static Semantics: Early Errors 22 23 UniqueFormalParameters:FormalParameters 24 25 - It is a Syntax Error if BoundNames of FormalParameters contains any 26 duplicate elements. 27 negative: 28 phase: parse 29 type: SyntaxError 30 ---*/ 31 32 $DONOTEVALUATE(); 33 34 0, (a, a) => { };