File: typeFromJSConstructor.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 (165 lines) | stat: -rw-r--r-- 4,624 bytes parent folder | download
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
=== tests/cases/conformance/salsa/a.js ===
function Installer () {
>Installer : typeof Installer

    // arg: number
    this.arg = 0
>this.arg = 0 : 0
>this.arg : any
>this : any
>arg : any
>0 : 0

    // unknown: string | boolean | null
    this.unknown = null
>this.unknown = null : null
>this.unknown : any
>this : any
>unknown : any
>null : null

    // twice: string | undefined
    this.twice = undefined
>this.twice = undefined : undefined
>this.twice : any
>this : any
>twice : any
>undefined : undefined

    this.twice = 'hi'
>this.twice = 'hi' : "hi"
>this.twice : any
>this : any
>twice : any
>'hi' : "hi"

    // twices: any[] | null
    this.twices = []
>this.twices = [] : never[]
>this.twices : any
>this : any
>twices : any
>[] : never[]

    this.twices = null
>this.twices = null : null
>this.twices : any
>this : any
>twices : any
>null : null
}
Installer.prototype.first = function () {
>Installer.prototype.first = function () {    this.arg = 'hi' // error    this.unknown = 'hi' // ok    this.newProperty = 1 // ok: number | boolean    this.twice = undefined // ok    this.twice = 'hi' // ok} : () => void
>Installer.prototype.first : any
>Installer.prototype : any
>Installer : typeof Installer
>prototype : any
>first : any
>function () {    this.arg = 'hi' // error    this.unknown = 'hi' // ok    this.newProperty = 1 // ok: number | boolean    this.twice = undefined // ok    this.twice = 'hi' // ok} : () => void

    this.arg = 'hi' // error
>this.arg = 'hi' : "hi"
>this.arg : number
>this : Installer
>arg : number
>'hi' : "hi"

    this.unknown = 'hi' // ok
>this.unknown = 'hi' : "hi"
>this.unknown : string | boolean | null
>this : Installer
>unknown : string | boolean | null
>'hi' : "hi"

    this.newProperty = 1 // ok: number | boolean
>this.newProperty = 1 : 1
>this.newProperty : number | boolean | undefined
>this : Installer
>newProperty : number | boolean | undefined
>1 : 1

    this.twice = undefined // ok
>this.twice = undefined : undefined
>this.twice : string | undefined
>this : Installer
>twice : string | undefined
>undefined : undefined

    this.twice = 'hi' // ok
>this.twice = 'hi' : "hi"
>this.twice : string | undefined
>this : Installer
>twice : string | undefined
>'hi' : "hi"
}
Installer.prototype.second = function () {
>Installer.prototype.second = function () {    this.arg = false // error    this.unknown = false // ok    this.newProperty = false // ok    this.twice = null // error    this.twice = false // error    this.twices.push(1) // error: Object is possibly null    if (this.twices != null) {        this.twices.push('hi')    }} : () => void
>Installer.prototype.second : any
>Installer.prototype : any
>Installer : typeof Installer
>prototype : any
>second : any
>function () {    this.arg = false // error    this.unknown = false // ok    this.newProperty = false // ok    this.twice = null // error    this.twice = false // error    this.twices.push(1) // error: Object is possibly null    if (this.twices != null) {        this.twices.push('hi')    }} : () => void

    this.arg = false // error
>this.arg = false : false
>this.arg : number
>this : Installer
>arg : number
>false : false

    this.unknown = false // ok
>this.unknown = false : false
>this.unknown : string | boolean | null
>this : Installer
>unknown : string | boolean | null
>false : false

    this.newProperty = false // ok
>this.newProperty = false : false
>this.newProperty : number | boolean | undefined
>this : Installer
>newProperty : number | boolean | undefined
>false : false

    this.twice = null // error
>this.twice = null : null
>this.twice : string | undefined
>this : Installer
>twice : string | undefined
>null : null

    this.twice = false // error
>this.twice = false : false
>this.twice : string | undefined
>this : Installer
>twice : string | undefined
>false : false

    this.twices.push(1) // error: Object is possibly null
>this.twices.push(1) : number
>this.twices.push : (...items: any[]) => number
>this.twices : any[] | null
>this : Installer
>twices : any[] | null
>push : (...items: any[]) => number
>1 : 1

    if (this.twices != null) {
>this.twices != null : boolean
>this.twices : any[] | null
>this : Installer
>twices : any[] | null
>null : null

        this.twices.push('hi')
>this.twices.push('hi') : number
>this.twices.push : (...items: any[]) => number
>this.twices : any[]
>this : Installer
>twices : any[]
>push : (...items: any[]) => number
>'hi' : "hi"
    }
}