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
|
=== tests/cases/compiler/thisInInnerFunctions.ts ===
class Foo {
>Foo : Symbol(Foo, Decl(thisInInnerFunctions.ts, 0, 0))
x = "hello";
>x : Symbol(Foo.x, Decl(thisInInnerFunctions.ts, 0, 11))
bar() {
>bar : Symbol(Foo.bar, Decl(thisInInnerFunctions.ts, 1, 16))
function inner() {
>inner : Symbol(inner, Decl(thisInInnerFunctions.ts, 2, 11))
this.y = "hi"; // 'this' should be not type to 'Foo' either
var f = () => this.y; // 'this' should be not type to 'Foo' either
>f : Symbol(f, Decl(thisInInnerFunctions.ts, 5, 15))
}
}
}
function test() {
>test : Symbol(test, Decl(thisInInnerFunctions.ts, 8, 1))
var x = () => {
>x : Symbol(x, Decl(thisInInnerFunctions.ts, 11, 7))
(() => this)();
this;
};
}
|