Skip to content

window.parent should be nullable #58464

Closed as not planned
Closed as not planned
@yohabe

Description

@yohabe

⚙ Compilation target

es2017

⚙ Library

ESNext

Missing / Incorrect Definition

In the whatwg definition, window.parent is nullable. whatwg/html#2123

The definition of window.parent in this repository is not nullable.

readonly parent: WindowProxy;

https://github.com/microsoft/TypeScript/blob/b9c71c3fc39f7cbafa82f8aa6f1d3b8a86e27ede/src/lib/dom.generated.d.ts#L26013-L26020

BTW, the definition of window.top is nullable, which is inconsistent.

 readonly top: WindowProxy | null;

https://github.com/microsoft/TypeScript/blob/b9c71c3fc39f7cbafa82f8aa6f1d3b8a86e27ede/src/lib/dom.generated.d.ts#L26069-L26070

Sample Code

readonly parent: WindowProxy;

Documentation Link

https://html.spec.whatwg.org/multipage/nav-history-apis.html#the-window-object

Metadata

Metadata

Assignees

No one assigned

    Labels

    Not a DefectThis behavior is one of several equally-correct options

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions