77 lines
2.8 KiB
Text
77 lines
2.8 KiB
Text
=== tests/cases/compiler/thisBinding2.ts ===
|
|
class C {
|
|
>C : C, Symbol(C,Decl(thisBinding2.ts,0,0))
|
|
|
|
x: number;
|
|
>x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
|
|
constructor() {
|
|
this.x = (() => {
|
|
>this.x = (() => { var x = 1; return this.x; })() : number
|
|
>this.x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
>this : C, Symbol(C,Decl(thisBinding2.ts,0,0))
|
|
>x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
>(() => { 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, Symbol(x,Decl(thisBinding2.ts,4,6))
|
|
>1 : number
|
|
|
|
return this.x;
|
|
>this.x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
>this : C, Symbol(C,Decl(thisBinding2.ts,0,0))
|
|
>x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
|
|
})();
|
|
this.x = function() {
|
|
>this.x = function() { var x = 1; return this.x; }() : any
|
|
>this.x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
>this : C, Symbol(C,Decl(thisBinding2.ts,0,0))
|
|
>x : number, Symbol(x,Decl(thisBinding2.ts,0,9))
|
|
>function() { var x = 1; return this.x; }() : any
|
|
>function() { var x = 1; return this.x; } : () => any
|
|
|
|
var x = 1;
|
|
>x : number, Symbol(x,Decl(thisBinding2.ts,8,6))
|
|
>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, Symbol(setTimeout,Decl(thisBinding2.ts,12,1))
|
|
>expression : any, Symbol(expression,Decl(thisBinding2.ts,13,28))
|
|
>msec : number, Symbol(msec,Decl(thisBinding2.ts,13,44))
|
|
>language : any, Symbol(language,Decl(thisBinding2.ts,13,59))
|
|
|
|
var messenger = {
|
|
>messenger : { message: string; start: () => number; }, Symbol(messenger,Decl(thisBinding2.ts,14,3))
|
|
>{ message: "Hello World", start: function () { return setTimeout(() => { var x = this.message; }, 3000); }} : { message: string; start: () => number; }
|
|
|
|
message: "Hello World",
|
|
>message : string, Symbol(message,Decl(thisBinding2.ts,14,17))
|
|
>"Hello World" : string
|
|
|
|
start: function () {
|
|
>start : () => number, Symbol(start,Decl(thisBinding2.ts,15,27))
|
|
>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, Symbol(setTimeout,Decl(thisBinding2.ts,12,1))
|
|
>() => { var x = this.message; } : () => void
|
|
>x : any, Symbol(x,Decl(thisBinding2.ts,17,37))
|
|
>this.message : any
|
|
>this : any
|
|
>message : any
|
|
>3000 : number
|
|
}
|
|
};
|
|
|