swc/crates/swc_ecma_parser/tests/tsc/privateNamesUseBeforeDef.ts
2022-02-04 17:08:38 +09:00

22 lines
295 B
TypeScript

// @target: es2015
class A {
#foo = this.#bar; // Error
#bar = 3;
}
class A2 {
#foo = this.#bar(); // No Error
#bar() { return 3 };
}
class A3 {
#foo = this.#bar; // No Error
get #bar() { return 3 };
}
class B {
#foo = this.#bar; // Error
#bar = this.#foo;
}