Skip to content

some document properties become optional #584

Closed
@ghost

Description

document.head
document.body
document.documentElement
...
now become an optional property, so all ts code written before 3.1 has to be modified. I've checked the reason and it's due to whatwg defined this(maybe it's defined by w3c before?)
https://html.spec.whatwg.org/multipage/dom.html#document

I think this change may cause much trouble to people who what to use new ts features yet have to write such ugly code everywhere:

     console.log(document.body!.width);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions