77 lines
1.9 KiB
Text
77 lines
1.9 KiB
Text
=== tests/cases/compiler/thisBinding2.ts ===
|
|
class C {
|
|
>C : C
|
|
|
|
x: number;
|
|
>x : number
|
|
|
|
constructor() {
|
|
this.x = (() => {
|
|
>this.x = (() => { var x = 1; return this.x; })() : number
|
|
>this.x : number
|
|
>this : C
|
|
>x : number
|
|
>(() => { var x = 1; return this.x; })() : number
|
|
>(() => { var x = 1; return this.x; }) : () => number
|
|
>() => { var x = 1; return this.x; } : () => number
|
|
|
|
var x = 1;
|
|
>x : number
|
|
>1 : number
|
|
|
|
return this.x;
|
|
>this.x : number
|
|
>this : C
|
|
>x : number
|
|
|
|
})();
|
|
this.x = function() {
|
|
>this.x = function() { var x = 1; return this.x; }() : any
|
|
>this.x : number
|
|
>this : C
|
|
>x : number
|
|
>function() { var x = 1; return this.x; }() : any
|
|
>function() { var x = 1; return this.x; } : () => any
|
|
|
|
var x = 1;
|
|
>x : number
|
|
>1 : number
|
|
|
|
return this.x;
|
|
>this.x : any
|
|
>this : any
|
|
>x : any
|
|
|
|
}();
|
|
}
|
|
}
|
|
declare function setTimeout(expression: any, msec?: number, language?: any): number;
|
|
>setTimeout : (expression: any, msec?: number, language?: any) => number
|
|
>expression : any
|
|
>msec : number
|
|
>language : any
|
|
|
|
var messenger = {
|
|
>messenger : { message: string; start: () => number; }
|
|
>{ message: "Hello World", start: function () { return setTimeout(() => { var x = this.message; }, 3000); }} : { message: string; start: () => number; }
|
|
|
|
message: "Hello World",
|
|
>message : string
|
|
>"Hello World" : string
|
|
|
|
start: function () {
|
|
>start : () => number
|
|
>function () { return setTimeout(() => { var x = this.message; }, 3000); } : () => number
|
|
|
|
return setTimeout(() => { var x = this.message; }, 3000);
|
|
>setTimeout(() => { var x = this.message; }, 3000) : number
|
|
>setTimeout : (expression: any, msec?: number, language?: any) => number
|
|
>() => { var x = this.message; } : () => void
|
|
>x : any
|
|
>this.message : any
|
|
>this : any
|
|
>message : any
|
|
>3000 : number
|
|
}
|
|
};
|
|
|