File: capturedParametersInInitializers2.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 (50 lines) | stat: -rw-r--r-- 999 bytes parent folder | download | duplicates (4)
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
=== tests/cases/compiler/capturedParametersInInitializers2.ts ===
function foo(
>foo : (y?: typeof (Anonymous class), x?: number, z?: number) => void

    y = class {
>y : typeof (Anonymous class)
>class {        static c = x;        get [x]() {return x;}        constructor() { x; }        [z]() { return z; }    } : typeof (Anonymous class)

        static c = x;
>c : number
>x : number

        get [x]() {return x;}
>[x] : number
>x : number
>x : number

        constructor() { x; }
>x : number

        [z]() { return z; }
>[z] : () => number
>z : number
>z : number

    },
    x = 1,
>x : number
>1 : 1

    z = 2
>z : number
>2 : 2

) {
    y.c
>y.c : number
>y : typeof (Anonymous class)
>c : number
}
function foo2(y = class {[x] = x}, x = 1) {
>foo2 : (y?: typeof (Anonymous class), x?: number) => void
>y : typeof (Anonymous class)
>class {[x] = x} : typeof (Anonymous class)
>[x] : number
>x : number
>x : number
>x : number
>1 : 1
}