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

31 lines
933 B
TypeScript

// @target: es2015
class C {
static #test: number = 24;
constructor() {
C.#test++;
C.#test--;
++C.#test;
--C.#test;
const a = C.#test++;
const b = C.#test--;
const c = ++C.#test;
const d = --C.#test;
for (C.#test = 0; C.#test < 10; ++C.#test) {}
for (C.#test = 0; C.#test < 10; C.#test++) {}
}
test() {
this.getClass().#test++;
this.getClass().#test--;
++this.getClass().#test;
--this.getClass().#test;
const a = this.getClass().#test++;
const b = this.getClass().#test--;
const c = ++this.getClass().#test;
const d = --this.getClass().#test;
for (this.getClass().#test = 0; this.getClass().#test < 10; ++this.getClass().#test) {}
for (this.getClass().#test = 0; this.getClass().#test < 10; this.getClass().#test++) {}
}
getClass() { return C; }
}