Skip to content

Attr.cloneNode() should return Attr, not Node #1260

@fonsp

Description

@fonsp

Expectation

Attr extends Node, but Attr.cloneNode() returns a new Attr, not just a Node.

Chrome dev tools:

Schermafbeelding 2022-02-04 om 23 47 06

Reality

But in lib.dom.d.ts, its return type is Node. This can give false errors, like this example from the VS Code TS linter:

Schermafbeelding 2022-02-04 om 23 43 52

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