Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dom): intersect defaultView with globalThis #820

Merged
merged 1 commit into from
Mar 17, 2020

Conversation

eps1lon
Copy link
Contributor

@eps1lon eps1lon commented Jan 27, 2020

Follow-up to #715

With #819 this change allows

declare const element: Element;
const isInput = element instanceof element.ownerDocument.defaultView!.HTMLInputElement;

Still requires non-null assertion which is fine. Above code will never be sound since defaultView might not be available. This is, at least for my purpose, alright.
Currently I simply have to @ts-ignore element.ownerDocument.defaultView.HTMLInputElement.

@eps1lon eps1lon requested a review from sandersn as a code owner January 27, 2020 15:30
@HolgerJeromin
Copy link
Contributor

This change is not unproblematic when used in iframes:
microsoft/TypeScript#41684 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants