mirror of
https://github.com/swc-project/swc.git
synced 2024-12-18 19:21:33 +03:00
22 lines
554 B
TypeScript
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; }
|
|
}
|