-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathtypeFromPropertyAssignment22.types
More file actions
55 lines (49 loc) · 2.13 KB
/
typeFromPropertyAssignment22.types
File metadata and controls
55 lines (49 loc) · 2.13 KB
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
=== tests/cases/conformance/salsa/npm-install.js ===
function Installer () {
>Installer : () => void
this.args = 0
>this.args = 0 : 0
>this.args : any
>this : any
>args : any
>0 : 0
}
Installer.prototype.loadArgMetadata = function (next) {
>Installer.prototype.loadArgMetadata = function (next) { // ArrowFunction isn't treated as a this-container (args) => { this.args = 'hi' this.newProperty = 1 }} : (next: any) => void
>Installer.prototype.loadArgMetadata : any
>Installer.prototype : any
>Installer : () => void
>prototype : any
>loadArgMetadata : any
>function (next) { // ArrowFunction isn't treated as a this-container (args) => { this.args = 'hi' this.newProperty = 1 }} : (next: any) => void
>next : any
// ArrowFunction isn't treated as a this-container
(args) => {
>(args) => { this.args = 'hi' this.newProperty = 1 } : (args: any) => void
>args : any
this.args = 'hi'
>this.args = 'hi' : "hi"
>this.args : string | number
>this : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>args : string | number
>'hi' : "hi"
this.newProperty = 1
>this.newProperty = 1 : 1
>this.newProperty : number | undefined
>this : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>newProperty : number | undefined
>1 : 1
}
}
var i = new Installer()
>i : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>new Installer() : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>Installer : () => void
i.newProperty = i.args // error, number | string =/> number | undefined
>i.newProperty = i.args : string | number
>i.newProperty : number | undefined
>i : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>newProperty : number | undefined
>i.args : string | number
>i : { args: string | number; loadArgMetadata: (next: any) => void; newProperty: number | undefined; }
>args : string | number