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

27 lines
446 B
TypeScript
Raw Normal View History

// @target: esnext
// @allowJS: true
// @declaration: true
// @emitDeclarationOnly: true
// @filename: file.js
export class C {
#hello = "hello";
#world = 100;
#calcHello() {
return this.#hello;
}
get #screamingHello() {
return this.#hello.toUpperCase();
}
/** @param value {string} */
set #screamingHello(value) {
throw "NO";
}
getWorld() {
return this.#world;
}
}