-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathcollisionThisExpressionAndLocalVarInLambda.types
More file actions
58 lines (52 loc) · 2.24 KB
/
collisionThisExpressionAndLocalVarInLambda.types
File metadata and controls
58 lines (52 loc) · 2.24 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
56
57
58
//// [tests/cases/compiler/collisionThisExpressionAndLocalVarInLambda.ts] ////
=== collisionThisExpressionAndLocalVarInLambda.ts ===
declare function alert(message?: any): void;
>alert : { (message?: string): void; (message?: any): void; }
> : ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^
>message : any
var x = {
>x : { doStuff: (callback: any) => () => any; }
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
>{ doStuff: (callback) => () => { var _this = 2; return callback(this); }} : { doStuff: (callback: any) => () => any; }
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
doStuff: (callback) => () => {
>doStuff : (callback: any) => () => any
> : ^ ^^^^^^^^^^^^^^^^^^^
>(callback) => () => { var _this = 2; return callback(this); } : (callback: any) => () => any
> : ^ ^^^^^^^^^^^^^^^^^^^
>callback : any
>() => { var _this = 2; return callback(this); } : () => any
> : ^^^^^^^^^
var _this = 2;
>_this : number
> : ^^^^^^
>2 : 2
> : ^
return callback(this);
>callback(this) : any
>callback : any
>this : typeof globalThis
> : ^^^^^^^^^^^^^^^^^
}
}
alert(x.doStuff(x => alert(x)));
>alert(x.doStuff(x => alert(x))) : void
> : ^^^^
>alert : { (message?: string): void; (message?: any): void; }
> : ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^
>x.doStuff(x => alert(x)) : () => any
> : ^^^^^^^^^
>x.doStuff : (callback: any) => () => any
> : ^ ^^^^^^^^^^^^^^^^^^^
>x : { doStuff: (callback: any) => () => any; }
> : ^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
>doStuff : (callback: any) => () => any
> : ^ ^^^^^^^^^^^^^^^^^^^
>x => alert(x) : (x: any) => void
> : ^ ^^^^^^^^^^^^^^
>x : any
>alert(x) : void
> : ^^^^
>alert : { (message?: string): void; (message?: any): void; }
> : ^^^ ^^^ ^^^ ^^^ ^^^ ^^^ ^^^
>x : any