TypeScript/tests/cases/compiler/thisInLambda.ts

18 lines
347 B
TypeScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
class Foo {
x = "hello";
bar() {
this.x; // 'this' is type 'Foo'
var f = () => this.x; // 'this' should be type 'Foo' as well
}
}
function myFn(a:any) { }
class myCls {
constructor () {
myFn(() => {
myFn(() => {
var x = this;
});
});
}
}