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

14 lines
292 B
TypeScript

// @target: es2015
const C = class {
#field = this.#method();
#method() { return 42; }
static getInstance() { return new C(); }
getField() { return this.#field };
}
console.log(C.getInstance().getField());
C.getInstance().#method; // Error
C.getInstance().#field; // Error