Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-meth-staticfield.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/class-elements/grammar-privatemeth-duplicate-meth-staticfield.case
4 // - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
5 /*---
6 description: It's a SyntaxError if a class contains a private method and a private static field with the same name (class declaration)
7 esid: prod-ClassElement
8 features: [class-methods-private, class-static-fields-private, class]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 Static Semantics: Early Errors
15
16 ClassBody : ClassElementList
17 It is a Syntax Error if PrivateBoundNames of ClassBody contains any duplicate entries, unless the name is used once for a getter and once for a setter and in no other entries.
18
19 ---*/
20
21
22 $DONOTEVALUATE();
23
24 class C {
25 static #m;
26 #m() {}
27 }