mirror of
https://github.com/swc-project/swc.git
synced 2024-11-24 10:12:42 +03:00
14 lines
292 B
TypeScript
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
|
|
|