-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this
Milestone
Description
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
Code
document.addEventListener("scroll", e => {
e.view;
});
Expected behavior:
This should not type check, as view
does not exist on Event. I ran into this because in Chrome (I tested on Chrome 60) event.view
is undefined for scroll
events. There's a Chromium issue from 2015 about emitting a UIEvent and is marked as WontFix, saying:
We intend to update the UIEvent spec to be consistent with this since we don't believe that anyone creates a UIEvent for 'scroll'.
The spec is updated and shows that scroll
events should just be an Event
rather than a UIEvent
.
Actual behavior:
e
is considered a UIEvent, which does have a view
property, and so the code type checks successfully.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do thisYou can do this