swc/crates/swc_ecma_parser/tests/tsc/privateNamesAndStaticMethods.ts

35 lines
661 B
TypeScript
Raw Normal View History

// @strict: true
// @target: esnext, es2022
// @lib: esnext, es2022
// @useDefineForClassFields: false
class A {
static #foo(a: number) {}
static async #bar(a: number) {}
static async *#baz(a: number) {
return 3;
}
static #_quux: number;
static get #quux (): number {
return this.#_quux;
}
static set #quux (val: number) {
this.#_quux = val;
}
constructor () {
A.#foo(30);
A.#bar(30);
A.#bar(30);
A.#quux = A.#quux + 1;
A.#quux++;
}
}
class B extends A {
static #foo(a: string) {}
constructor () {
super();
B.#foo("str");
}
}