TypeScript-DOM-lib-generator
TypeScript-DOM-lib-generator copied to clipboard
cloneNode Return Type Must Be Active Class, Not Base Class (Node)
The cloneNode return type is incorrect as per #283, #302, https://github.com/microsoft/TypeScript/issues/17818 and #1578. The type before this PR indicated that cloneNode returned a Node, which then broke any class that extended Node. In reality, cloneNode will return an instance of whatever the current class type is, a.k.a. this (DocumentFragment#cloneNode returns a DocumentFragment, not a Node).
This PR solves this issue by changing the return type of Node#cloneNode to this.