File: classExpressionWithStaticProperties3.types

package info (click to toggle)
node-typescript 3.3.3333-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 324,548 kB
  • sloc: makefile: 6; sh: 3
file content (57 lines) | stat: -rw-r--r-- 1,504 bytes parent folder | download | duplicates (5)
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
=== tests/cases/compiler/classExpressionWithStaticProperties3.ts ===
declare var console: any;
>console : any

const arr: {y(): number}[] = [];
>arr : { y(): number; }[]
>y : () => number
>[] : undefined[]

for (let i = 0; i < 3; i++) {
>i : number
>0 : 0
>i < 3 : boolean
>i : number
>3 : 3
>i++ : number
>i : number

    arr.push(class C {
>arr.push(class C {        static x = i;        static y = () => C.x * 2;    }) : number
>arr.push : (...items: { y(): number; }[]) => number
>arr : { y(): number; }[]
>push : (...items: { y(): number; }[]) => number
>class C {        static x = i;        static y = () => C.x * 2;    } : typeof C
>C : typeof C

        static x = i;
>x : number
>i : number

        static y = () => C.x * 2;
>y : () => number
>() => C.x * 2 : () => number
>C.x * 2 : number
>C.x : number
>C : typeof C
>x : number
>2 : 2

    });
}
arr.forEach(C => console.log(C.y()));
>arr.forEach(C => console.log(C.y())) : void
>arr.forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
>arr : { y(): number; }[]
>forEach : (callbackfn: (value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg?: any) => void
>C => console.log(C.y()) : (C: { y(): number; }) => any
>C : { y(): number; }
>console.log(C.y()) : any
>console.log : any
>console : any
>log : any
>C.y() : number
>C.y : () => number
>C : { y(): number; }
>y : () => number