File: privateNameAccessorsCallExpression.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (95 lines) | stat: -rw-r--r-- 2,123 bytes parent folder | download | duplicates (3)
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
=== tests/cases/conformance/classes/members/privateNames/privateNameAccessorsCallExpression.ts ===
class A {
>A : A

    get #fieldFunc() {  return function() { this.x = 10; } }
>#fieldFunc : () => void
>function() { this.x = 10; } : () => void
>this.x = 10 : 10
>this.x : any
>this : any
>x : any
>10 : 10

    get #fieldFunc2() { return  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

        this.#fieldFunc();
>this.#fieldFunc() : void
>this.#fieldFunc : () => void
>this : this

        const func = this.#fieldFunc;
>func : () => void
>this.#fieldFunc : () => void
>this : this

        func();
>func() : void
>func : () => void

        new this.#fieldFunc();
>new this.#fieldFunc() : any
>this.#fieldFunc : () => void
>this : this

        const arr = [ 1, 2 ];
>arr : number[]
>[ 1, 2 ] : number[]
>1 : 1
>2 : 2

        this.#fieldFunc2(0, ...arr, 3);
>this.#fieldFunc2(0, ...arr, 3) : void
>this.#fieldFunc2 : (a: any, ...b: any[]) => void
>this : this
>0 : 0
>...arr : number
>arr : number[]
>3 : 3

        const b = new this.#fieldFunc2(0, ...arr, 3);
>b : any
>new this.#fieldFunc2(0, ...arr, 3) : any
>this.#fieldFunc2 : (a: any, ...b: any[]) => void
>this : this
>0 : 0
>...arr : number
>arr : number[]
>3 : 3

        const str = this.#fieldFunc2`head${1}middle${2}tail`;
>str : void
>this.#fieldFunc2`head${1}middle${2}tail` : void
>this.#fieldFunc2 : (a: any, ...b: any[]) => void
>this : this
>`head${1}middle${2}tail` : string
>1 : 1
>2 : 2

        this.getInstance().#fieldFunc2`test${1}and${2}`;
>this.getInstance().#fieldFunc2`test${1}and${2}` : void
>this.getInstance().#fieldFunc2 : (a: any, ...b: any[]) => void
>this.getInstance() : A
>this.getInstance : () => A
>this : this
>getInstance : () => A
>`test${1}and${2}` : string
>1 : 1
>2 : 2
    }
    getInstance() { return new A(); }
>getInstance : () => A
>new A() : A
>A : typeof A
}