Debian Codegraph @

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

raw
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 class Foo {
28 foo(a, a) { }
29 }