Selector in Element.matches() should type narrow#2147
Conversation
|
Thanks for the PR! This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged. |
|
@microsoft-github-policy-service agree company="040 Internet AB" |
|
LGTM for now, but I think this should ultimately move to a patch rather than in the emitter itself.\ |
|
There was an issue merging, maybe try again saschanaz. Details |
|
@saschanaz Weird error: "HttpError: Repository rule violations found New changes require approval from someone other than the last pusher. " |
|
It's unfortunately normal, the infra was written before new rules required approval from someone with merge perms (defeating the purpose more or less). I wasn't sure if the comment was an actual ask to merge or not, but I can just approve it. |
|
LGTM |
|
Merging because @saschanaz is a code-owner of all the changes - thanks! |
|
This change breaks code: microsoft/TypeScript#63497 |
Adds TypeScript overloads for the
matchesmethod.The overloads leverages the
HTMLElementTagNameMapsimilar to how overloads are handled for methods likequerySelector, but here for type narrowing by making it eg.this is HTMLElementTagNameMap[K].Tests have been run locally and are passing.
Changes:
emitMatchesOverloadsto generate overload signatures for thematchesmethod.emitMatchesOverloadswhen processing thematchesmethod.