Skip to content

Node.insertBefore() second parameter is not optional #8320

Closed
@ntrrgc

Description

@ntrrgc

This is in the definition of a DOM Node, from lib.d.ts:

insertBefore(newChild: Node, refChild?: Node): Node;

According to it, refChild is optional, which is not true according to the MDN documentation and certainly causes a runtime error in Google Chrome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptFixedA PR has been merged for this issueHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions