File: destructuringParameterProperties5.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 (94 lines) | stat: -rw-r--r-- 1,946 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
=== tests/cases/conformance/es6/destructuring/destructuringParameterProperties5.ts ===
type ObjType1 = { x: number; y: string; z: boolean }
>ObjType1 : { x: number; y: string; z: boolean; }
>x : number
>y : string
>z : boolean

type TupleType1 = [ObjType1, number, string]
>TupleType1 : [ObjType1, number, string]

class C1 {
>C1 : C1

    constructor(public [{ x1, x2, x3 }, y, z]: TupleType1) {
>x1 : any
>x2 : any
>x3 : any
>y : number
>z : string

        var foo: any = x1 || x2 || x3 || y || z;
>foo : any
>x1 || x2 || x3 || y || z : any
>x1 || x2 || x3 || y : any
>x1 || x2 || x3 : any
>x1 || x2 : any
>x1 : any
>x2 : any
>x3 : any
>y : number
>z : string

        var bar: any = this.x1 || this.x2 || this.x3 || this.y || this.z;
>bar : any
>this.x1 || this.x2 || this.x3 || this.y || this.z : any
>this.x1 || this.x2 || this.x3 || this.y : any
>this.x1 || this.x2 || this.x3 : any
>this.x1 || this.x2 : any
>this.x1 : any
>this : this
>x1 : any
>this.x2 : any
>this : this
>x2 : any
>this.x3 : any
>this : this
>x3 : any
>this.y : any
>this : this
>y : any
>this.z : any
>this : this
>z : any
    }
}

var a = new C1([{ x1: 10, x2: "", x3: true }, "", false]);
>a : C1
>new C1([{ x1: 10, x2: "", x3: true }, "", false]) : C1
>C1 : typeof C1
>[{ x1: 10, x2: "", x3: true }, "", false] : [{ x1: number; x2: string; x3: boolean; }, string, boolean]
>{ x1: 10, x2: "", x3: true } : { x1: number; x2: string; x3: boolean; }
>x1 : number
>10 : 10
>x2 : string
>"" : ""
>x3 : boolean
>true : true
>"" : ""
>false : false

var [a_x1, a_x2, a_x3, a_y, a_z] = [a.x1, a.x2, a.x3, a.y, a.z];
>a_x1 : any
>a_x2 : any
>a_x3 : any
>a_y : any
>a_z : any
>[a.x1, a.x2, a.x3, a.y, a.z] : [any, any, any, any, any]
>a.x1 : any
>a : C1
>x1 : any
>a.x2 : any
>a : C1
>x2 : any
>a.x3 : any
>a : C1
>x3 : any
>a.y : any
>a : C1
>y : any
>a.z : any
>a : C1
>z : any