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

22 lines
554 B
TypeScript

// @target: es2015
class A {
static #fieldFunc = function () { this.x = 10; };
static #fieldFunc2 = function (a, ...b) {};
x = 1;
test() {
A.#fieldFunc();
A.#fieldFunc?.();
const func = A.#fieldFunc;
func();
new A.#fieldFunc();
const arr = [ 1, 2 ];
A.#fieldFunc2(0, ...arr, 3);
const b = new A.#fieldFunc2(0, ...arr, 3);
const str = A.#fieldFunc2`head${1}middle${2}tail`;
this.getClass().#fieldFunc2`test${1}and${2}`;
}
getClass() { return A; }
}