mirror of
https://github.com/swc-project/swc.git
synced 2024-12-26 15:12:08 +03:00
22 lines
571 B
TypeScript
22 lines
571 B
TypeScript
// @target: es2015
|
|
|
|
class A {
|
|
#fieldFunc = function() { this.x = 10; };
|
|
#fieldFunc2 = function(a, ...b) {};
|
|
x = 1;
|
|
test() {
|
|
this.#fieldFunc();
|
|
this.#fieldFunc?.();
|
|
const func = this.#fieldFunc;
|
|
func();
|
|
new this.#fieldFunc();
|
|
|
|
const arr = [ 1, 2 ];
|
|
this.#fieldFunc2(0, ...arr, 3);
|
|
const b = new this.#fieldFunc2(0, ...arr, 3);
|
|
const str = this.#fieldFunc2`head${1}middle${2}tail`;
|
|
this.getInstance().#fieldFunc2`test${1}and${2}`;
|
|
}
|
|
getInstance() { return new A(); }
|
|
}
|