2014-08-15 23:33:16 +02:00
|
|
|
=== tests/cases/compiler/selfInLambdas.ts ===
|
|
|
|
interface MouseEvent {
|
|
|
|
>MouseEvent : MouseEvent
|
|
|
|
|
|
|
|
x: number;
|
|
|
|
>x : number
|
|
|
|
|
|
|
|
y: number;
|
|
|
|
>y : number
|
|
|
|
}
|
|
|
|
|
|
|
|
declare var window: Window;
|
|
|
|
>window : Window
|
|
|
|
>Window : Window
|
|
|
|
|
|
|
|
interface Window {
|
|
|
|
>Window : Window
|
|
|
|
|
|
|
|
onmousemove: (ev: MouseEvent) => any;
|
|
|
|
>onmousemove : (ev: MouseEvent) => any
|
|
|
|
>ev : MouseEvent
|
|
|
|
>MouseEvent : MouseEvent
|
|
|
|
|
|
|
|
}
|
|
|
|
var o = {
|
|
|
|
>o : { counter: number; start: () => void; }
|
2014-08-22 03:39:46 +02:00
|
|
|
>{ counter: 0, start: function() { window.onmousemove = () => { this.counter++ var f = () => this.counter; } }} : { counter: number; start: () => void; }
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
counter: 0,
|
|
|
|
>counter : number
|
|
|
|
|
|
|
|
start: function() {
|
|
|
|
>start : () => void
|
2014-08-22 03:39:46 +02:00
|
|
|
>function() { window.onmousemove = () => { this.counter++ var f = () => this.counter; } } : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
window.onmousemove = () => {
|
2014-08-22 03:39:46 +02:00
|
|
|
>window.onmousemove = () => { this.counter++ var f = () => this.counter; } : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
>window.onmousemove : (ev: MouseEvent) => any
|
|
|
|
>window : Window
|
|
|
|
>onmousemove : (ev: MouseEvent) => any
|
2014-08-22 03:39:46 +02:00
|
|
|
>() => { this.counter++ var f = () => this.counter; } : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
this.counter++
|
|
|
|
>this.counter++ : number
|
|
|
|
>this.counter : any
|
|
|
|
>this : any
|
|
|
|
>counter : any
|
|
|
|
|
|
|
|
var f = () => this.counter;
|
|
|
|
>f : () => any
|
|
|
|
>() => this.counter : () => any
|
|
|
|
>this.counter : any
|
|
|
|
>this : any
|
|
|
|
>counter : any
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class X {
|
|
|
|
>X : X
|
|
|
|
|
|
|
|
private value = "value";
|
|
|
|
>value : string
|
|
|
|
|
|
|
|
public foo() {
|
|
|
|
>foo : () => void
|
|
|
|
|
|
|
|
var outer= () => {
|
|
|
|
>outer : () => void
|
2014-08-22 03:39:46 +02:00
|
|
|
>() => { var x = this.value; var inner = () => { var y = this.value; } inner(); } : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var x = this.value;
|
|
|
|
>x : string
|
|
|
|
>this.value : string
|
|
|
|
>this : X
|
|
|
|
>value : string
|
|
|
|
|
|
|
|
var inner = () => {
|
|
|
|
>inner : () => void
|
2014-08-22 03:39:46 +02:00
|
|
|
>() => { var y = this.value; } : () => void
|
2014-08-15 23:33:16 +02:00
|
|
|
|
|
|
|
var y = this.value;
|
|
|
|
>y : string
|
|
|
|
>this.value : string
|
|
|
|
>this : X
|
|
|
|
>value : string
|
|
|
|
}
|
|
|
|
|
|
|
|
inner();
|
|
|
|
>inner() : void
|
|
|
|
>inner : () => void
|
|
|
|
|
|
|
|
};
|
|
|
|
outer();
|
|
|
|
>outer() : void
|
|
|
|
>outer : () => void
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|