File: typeOfThisInStaticMembers8%28target%3Des2022%29.types

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (77 lines) | stat: -rw-r--r-- 2,046 bytes parent folder | download | duplicates (12)
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
=== tests/cases/conformance/classes/members/instanceAndStaticMembers/typeOfThisInStaticMembers8.ts ===
class C {
>C : C

    static f = 1;
>f : number
>1 : 1

    static arrowFunctionBoundary = () => this.f + 1;
>arrowFunctionBoundary : () => number
>() => this.f + 1 : () => number
>this.f + 1 : number
>this.f : number
>this : typeof C
>f : number
>1 : 1

    static functionExprBoundary = function () { return this.f + 2 };
>functionExprBoundary : () => any
>function () { return this.f + 2 } : () => any
>this.f + 2 : any
>this.f : any
>this : any
>f : any
>2 : 2

    static classExprBoundary = class { a = this.f + 3 };
>classExprBoundary : typeof (Anonymous class)
>class { a = this.f + 3 } : typeof (Anonymous class)
>a : any
>this.f + 3 : any
>this.f : any
>this : this
>f : any
>3 : 3

    static functionAndClassDeclBoundary = (() => {
>functionAndClassDeclBoundary : void
>(() => {        function foo () {            return this.f + 4        }        class CC {            a = this.f + 5            method () {                return this.f + 6            }        }    })() : void
>(() => {        function foo () {            return this.f + 4        }        class CC {            a = this.f + 5            method () {                return this.f + 6            }        }    }) : () => void
>() => {        function foo () {            return this.f + 4        }        class CC {            a = this.f + 5            method () {                return this.f + 6            }        }    } : () => void

        function foo () {
>foo : () => any

            return this.f + 4
>this.f + 4 : any
>this.f : any
>this : any
>f : any
>4 : 4
        }
        class CC {
>CC : CC

            a = this.f + 5
>a : any
>this.f + 5 : any
>this.f : any
>this : this
>f : any
>5 : 5

            method () {
>method : () => any

                return this.f + 6
>this.f + 6 : any
>this.f : any
>this : this
>f : any
>6 : 6
            }
        }
    })();
}