You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class X {
foo() {
}
bar() {
setTimeout(function() {
this.foo();
}, 10)
}
}
I really should get some sort of warning that "this" doesn't mean what I think it means (or that I should use lambda syntax). This has bitten me repeatedly as I've been converting js code into ts code.
The text was updated successfully, but these errors were encountered:
The behavior as-is is by design, as sometimes you really do need the this that isn't the lexical one. We're tracking the general problem in hope of solution in the referenced issue and others; no need for a separate one here.
If my class consists of
I really should get some sort of warning that "this" doesn't mean what I think it means (or that I should use lambda syntax). This has bitten me repeatedly as I've been converting js code into ts code.
The text was updated successfully, but these errors were encountered: