Debian Codegraph @

js/src/tests/test262/language/statements/class/elements/syntax/early-errors/grammar-private-field-on-object-destructuring.js

raw
1 // |reftest| error:SyntaxError
2 // This file was procedurally generated from the following sources:
3 // - src/class-elements/grammar-private-field-on-object-destructuring.case
4 // - src/class-elements/syntax/invalid/cls-decl-elements-invalid-syntax.template
5 /*---
6 description: Acessing private field from object destructuring pattern is not a valid syntax (class declaration)
7 esid: prod-ClassElement
8 features: [class-fields-private, destructuring-binding, class]
9 flags: [generated]
10 negative:
11 phase: parse
12 type: SyntaxError
13 info: |
14 Updated Productions
15
16 ObjectAssignmentPattern[Yield, Await]:
17 {}
18 {AssignmentRestProperty[?Yield, ?Await]}
19 {AssignmentPropertyList[?Yield, ?Await]}
20 {AssignmentPropertyList[?Yield, ?Await],AssignmentRestProperty[?Yield, ?Await]opt}
21
22 ---*/
23
24
25 $DONOTEVALUATE();
26
27 class C {
28 #x = 1;
29
30 destructureX() {
31 const { #x: x } = this;
32 }
33 }