early-errors-arrow-duplicate-parameters.js (977B)
1 // |reftest| error:SyntaxError 2 // Copyright 2016 Microsoft, Inc. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 author: Brian Terlson <brian.terlson@microsoft.com> 7 esid: sec-async-arrow-function-definitions 8 description: Formal parameters may not contain duplicates 9 info: | 10 # 14.2 Arrow Function Definitions 11 12 When the production 13 14 ArrowParameters:CoverParenthesizedExpressionAndArrowParameterList 15 16 is recognized the following grammar is used to refine the interpretation 17 of CoverParenthesizedExpressionAndArrowParameterList: 18 19 ArrowFormalParameters[Yield, Await]: 20 (UniqueFormalParameters[?Yield, ?Await]) 21 22 # 14.1.2 Static Semantics: Early Errors 23 24 UniqueFormalParameters:FormalParameters 25 26 - It is a Syntax Error if BoundNames of FormalParameters contains any 27 duplicate elements. 28 negative: 29 phase: parse 30 type: SyntaxError 31 features: [async-functions] 32 ---*/ 33 34 $DONOTEVALUATE(); 35 36 async(a, a) => { }