TypeScript-DOM-lib-generator icon indicating copy to clipboard operation
TypeScript-DOM-lib-generator copied to clipboard

Simplify / fix HTMLCollection overrides

Open RReverser opened this issue 5 years ago • 3 comments

Use an extra optional type param on HTMLCollection for namedItem override.

This simplifies / removes quite a lot of emitter code that was necessary to maintain just for this override.

Instead, this PR is using regular backward-compatible type system capabilities.

As an additional benefit, this removes a phantom HTMLCollectionOf class that previously appeared as a valid global, but doesn't really exist in JavaScript global object.

RReverser avatar Dec 18 '19 19:12 RReverser

I came across this while implementing #222, but decided it's worthwile to separate out this refactoring into its own PR as it's not strictly related to that issue.

RReverser avatar Dec 18 '19 19:12 RReverser

Revisiting this after 2 years... 😅

Now that I have a permission to merge, I find this beneficial with no regression. Could you try rebasing? I can cherry-pick this PR if you are too busy. Thank you!

saschanaz avatar Dec 11 '21 14:12 saschanaz

Lol it's been a while, yeah 😅 If you could rebase on your side, that would be great, yeah.

RReverser avatar Dec 11 '21 17:12 RReverser