summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/class/elements/syntax/early-errors/grammar-privatemeth-duplicate-set-field.js
blob: d122f531ae0674204345a7c0c8c2f124160e0b77 (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
// |reftest| error:SyntaxError
// This file was procedurally generated from the following sources:
// - src/class-elements/grammar-privatemeth-duplicate-set-field.case
// - src/class-elements/syntax/invalid/cls-expr-elements-invalid-syntax.template
/*---
description: It's a SyntaxError if a class contains a private setter and a private field with the same name (class expression)
esid: prod-ClassElement
features: [class-methods-private, class-fields-private, class]
flags: [generated]
negative:
  phase: parse
  type: SyntaxError
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.

---*/


$DONOTEVALUATE();

var C = class {
  #m;
  set #m(_) {}
};