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

14 lines
400 B
TypeScript

// @target: es2015
class A3 {
#method() { };
constructor(a: A3, b: any) {
this.#method = () => {} // Error, not writable
a.#method = () => { }; // Error, not writable
b.#method = () => { } //Error, not writable
({ x: this.#method } = { x: () => {}}); //Error, not writable
let x = this.#method;
b.#method++ //Error, not writable
}
}