summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/class/elements/syntax/valid/grammar-privatemeth-duplicate-meth-nestedclassmeth.js
blob: ef9ea621c2dc030a46ef0a2eef59fa35b06a7a6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-privatemeth-duplicate-meth-nestedclassmeth.case
// - src/class-elements/syntax/valid/cls-decl-elements-valid-syntax.template
/*---
description: It's valid if a nested class shadows a private method (class declaration)
esid: prod-ClassElement
features: [class-methods-private, class]
flags: [generated]
info: |
    Static Semantics: Early Errors

    ClassBody : ClassElementList
        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.

---*/


class C {
  constructor() {
    class B {
      #m() {}
    }
  }

  #m() {}
}

reportCompare(0, 0);