-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Open
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
I just spent 2 hours tracking down this issue:
- We have a class with a prototype method called
focus()
- Our code was calling
focus()
, but it should have been callingthis.focus()
- The code compiled fine, because
window.focus()
shares the same signature as ourfocus()
method
Is there a way to throw a compile time error when implicitly accessing global methods (on window
, global
, etc.)?
If not, a compiler flag would be extremely helpful. I would happily be more explicit about commonly used globals (window.setTimeout
, window.document
, ...) if it meant I could more easily catch insidious bugs like this one.
Full commit here: coatue-oss/slickgrid2@0f8bab3.
niieani, christyharagan, krryan, drake7707, Knagis and 118 moreniedzielskijoelmalone, eric-burel, niedzielski and PavelKoroteevniedzielski
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript