1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
=== tests/cases/conformance/classes/members/privateNames/privateNameStaticFieldCallExpression.ts ===
class A {
>A : A
static #fieldFunc = function () { this.x = 10; };
>#fieldFunc : () => void
>function () { this.x = 10; } : () => void
>this.x = 10 : 10
>this.x : any
>this : any
>x : any
>10 : 10
static #fieldFunc2 = function (a, ...b) {};
>#fieldFunc2 : (a: any, ...b: any[]) => void
>function (a, ...b) {} : (a: any, ...b: any[]) => void
>a : any
>b : any[]
x = 1;
>x : number
>1 : 1
test() {
>test : () => void
A.#fieldFunc();
>A.#fieldFunc() : void
>A.#fieldFunc : () => void
>A : typeof A
A.#fieldFunc?.();
>A.#fieldFunc?.() : void
>A.#fieldFunc : () => void
>A : typeof A
const func = A.#fieldFunc;
>func : () => void
>A.#fieldFunc : () => void
>A : typeof A
func();
>func() : void
>func : () => void
new A.#fieldFunc();
>new A.#fieldFunc() : any
>A.#fieldFunc : () => void
>A : typeof A
const arr = [ 1, 2 ];
>arr : number[]
>[ 1, 2 ] : number[]
>1 : 1
>2 : 2
A.#fieldFunc2(0, ...arr, 3);
>A.#fieldFunc2(0, ...arr, 3) : void
>A.#fieldFunc2 : (a: any, ...b: any[]) => void
>A : typeof A
>0 : 0
>...arr : number
>arr : number[]
>3 : 3
const b = new A.#fieldFunc2(0, ...arr, 3);
>b : any
>new A.#fieldFunc2(0, ...arr, 3) : any
>A.#fieldFunc2 : (a: any, ...b: any[]) => void
>A : typeof A
>0 : 0
>...arr : number
>arr : number[]
>3 : 3
const str = A.#fieldFunc2`head${1}middle${2}tail`;
>str : void
>A.#fieldFunc2`head${1}middle${2}tail` : void
>A.#fieldFunc2 : (a: any, ...b: any[]) => void
>A : typeof A
>`head${1}middle${2}tail` : string
>1 : 1
>2 : 2
this.getClass().#fieldFunc2`test${1}and${2}`;
>this.getClass().#fieldFunc2`test${1}and${2}` : void
>this.getClass().#fieldFunc2 : (a: any, ...b: any[]) => void
>this.getClass() : typeof A
>this.getClass : () => typeof A
>this : this
>getClass : () => typeof A
>`test${1}and${2}` : string
>1 : 1
>2 : 2
}
getClass() { return A; }
>getClass : () => typeof A
>A : typeof A
}
|