Debian Codegraph @

js/src/tests/test262/language/statements/class/definition/early-errors-class-async-method-duplicate-parameters.js

raw
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 <[email protected]>
7 esid: sec-async-function-definitions
8 description: Formal parameters may not contain duplicates
9 info: |
10 # 14.7 Arrow Function Definitions
11
12 AsyncMethod[Yield, Await]:
13 async[no LineTerminator here]PropertyName[?Yield, ?Await](UniqueFormalParameters[~Yield, +Await]){AsyncFunctionBody}
14
15 # 14.1.2 Static Semantics: Early Errors
16
17 UniqueFormalParameters:FormalParameters
18
19 - It is a Syntax Error if BoundNames of FormalParameters contains any
20 duplicate elements.
21 negative:
22 phase: parse
23 type: SyntaxError
24 ---*/
25
26 $DONOTEVALUATE();
27
28 class Foo {
29 async foo(a, a) { }
30 }