Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Various return types in NamedNodeMap in lib.dom.d.ts are slightly inaccurate #18129

Closed
dsifford opened this issue Aug 29, 2017 · 4 comments
Labels
Duplicate An existing issue was already created

Comments

@dsifford
Copy link
Contributor

It's my understanding that getNamedItem, getNamedItemNS, and item should return null if the Attr node is undefined or out of range.

Additionally, it's my understanding that the return value of the indexed properties should be undefined if out of range.

Sources:

"The NamedNodeMap.getNamedItem() method returns the Attr corresponding to the given name, or null if there is no corresponding attribute." [Via MDN]

"NamedNodeMap.item() returns the Attr at the given index, or null if the index is higher or equal to the number of nodes." [Via MDN]

https://github.com/Microsoft/TypeScript/blob/d7b3b6c77d45adc4542c882a3f19d2f0fdb3e76c/lib/lib.dom.d.ts#L8187-L8197

Let me know if I'm mistaken. I'm always up to learn! 😄

Thanks in advance team for all your hard work!

@mhegazy mhegazy added the Needs Investigation This issue needs a team member to investigate its status. label Aug 29, 2017
@dsifford
Copy link
Contributor Author

Whoops.. Dupe of #17695!

Happy to send in a PR if needed.

@mhegazy mhegazy added Duplicate An existing issue was already created and removed Needs Investigation This issue needs a team member to investigate its status. labels Aug 29, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 29, 2017

PRs welcomed.

@dsifford
Copy link
Contributor Author

@mhegazy Great! I'll keep an eye on this and get to it in the next couple of days if it hasn't been taken care of yet. Thanks!

@mhegazy
Copy link
Contributor

mhegazy commented Sep 12, 2017

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

@mhegazy mhegazy closed this as completed Sep 12, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants