Debian Codegraph @

packages/babel-plugin-proposal-class-properties/test/fixtures/private/access-before-declaration/exec.js

raw
1 expect(() => {
2 class C {
3 static #_ = new C;
4 static #p;
5 constructor() {
6 C.#p;
7 }
8 }
9 }).toThrow(/attempted to get private static field before its declaration/);
10
11 expect(() => {
12 class C {
13 static #_ = new C;
14 static #p;
15 constructor() {
16 C.#p = 0;
17 }
18 }
19 }).toThrow(/attempted to set private static field before its declaration/);
20
21 expect(() => {
22 class C {
23 static #_ = new C;
24 static #p;
25 constructor() {
26 for (C.#p of [0]);
27 }
28 }
29 }).toThrow(/attempted to set private static field before its declaration/);