-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA 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 TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
lib.dom.ts defines Node.parentElement as never-null:
https://github.com/Microsoft/TypeScript/blob/95c3eccbe9f3f7e1857ce157d437e6b80b3c9c6f/lib/lib.dom.d.ts#L8749
However, it's a pretty common pattern to write loops like
while (n.parentElement != null) {
// [...]
n = n.parentElement;
}
to walk up the node tree.
Also parentNode, previousSibling, nextSibling, firstChild, lastChild... (?)
tinganho
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA 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 TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this