Skip to content

ChildNode shouldn't be separated from Node #27453

Closed
@nin-jin

Description

@nin-jin

TypeScript Version: 3.1.1

Search Terms: ChildNode

Code

let x = document.body.childNodes[1]
x = document.body.firstChild.nextSibling

Expected behavior:

No error. Type of node shouldn't depends on getting way.

Actual behavior:
Error:

Type 'Node' is not assignable to type 'ChildNode'.
  Property 'after' is missing in type 'Node'.

Playground Link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions