mirror of
https://github.com/tc39/test262.git
synced 2025-04-08 19:35:28 +02:00
Previously, the early error prohibiting duplicate entries in UniqueFormalParameters was only tested in terms of async functions. In one case, this was misattributed to UniqeFormalParameters and only enforced for strict mode code. Extend coverage to the other function-creating productions which include UniqueFormalParameters (i.e. method definitions and non-async arrow functions), and update the existing tests to more accurately describe the source of the error.
35 lines
918 B
JavaScript
35 lines
918 B
JavaScript
// Copyright 2016 Microsoft, Inc. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
author: Brian Terlson <brian.terlson@microsoft.com>
|
|
esid: sec-async-arrow-function-definitions
|
|
description: Formal parameters may not contain duplicates
|
|
info: |
|
|
# 14.2 Arrow Function Definitions
|
|
|
|
When the production
|
|
|
|
ArrowParameters:CoverParenthesizedExpressionAndArrowParameterList
|
|
|
|
is recognized the following grammar is used to refine the interpretation
|
|
of CoverParenthesizedExpressionAndArrowParameterList:
|
|
|
|
ArrowFormalParameters[Yield, Await]:
|
|
(UniqueFormalParameters[?Yield, ?Await])
|
|
|
|
# 14.1.2 Static Semantics: Early Errors
|
|
|
|
UniqueFormalParameters:FormalParameters
|
|
|
|
- It is a Syntax Error if BoundNames of FormalParameters contains any
|
|
duplicate elements.
|
|
negative:
|
|
phase: parse
|
|
type: SyntaxError
|
|
---*/
|
|
|
|
$DONOTEVALUATE();
|
|
|
|
async(a, a) => { }
|