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

17 lines
313 B
TypeScript

// @strict: true
// @target: es6
class A1 {
get #prop() { return ""; }
set #prop(param: string) { }
get #roProp() { return ""; }
constructor(name: string) {
this.#prop = "";
this.#roProp = ""; // Error
console.log(this.#prop);
console.log(this.#roProp);
}
}