Skip to content

Fix multiple issues with FinalizationRegistry content #17126

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

Merged
merged 4 commits into from
Jun 10, 2022

Conversation

Josh-Cena
Copy link
Member

Summary

Motivation

Fix #13695

Supporting details

Related issues

Metadata

  • Adds a new document
  • Rewrites (or significantly expands) a document
  • Fixes a typo, bug, or other error

@Josh-Cena Josh-Cena requested a review from a team as a code owner June 9, 2022 04:43
@Josh-Cena Josh-Cena requested review from wbamberg and removed request for a team June 9, 2022 04:43
@github-actions github-actions bot added the Content:JS JavaScript docs label Jun 9, 2022
Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot.

I think there are extra things that should be updated. What do you think?


### Return value

`undefined`.
`true` if at least one cell was unregistered; `false` if no cell was unregistered.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the boolean value, I think there are cases where undefined can be returned, am I wrong?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't find it in spec. It either returns a boolean, or throws a TypeError.


### Return value

`undefined`.
`true` if at least one cell was unregistered; `false` if no cell was unregistered.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have cases where the {{jsxref("TypeError")}} exception is raised. We likely want an ### Exceptions section.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense—when I work on these docs there are a lot of sections missing mentions of exceptions. Is there a convention for how this should be structured? Or just an h3 section.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should add them as we do for API, with a definition list in that section: https://developer.mozilla.org/en-US/docs/MDN/Structures/Page_types/API_method_subpage_template#exceptions

Something like: https://developer.mozilla.org/en-US/docs/Web/API/IDBCursor/continue#exceptions

And yes, there are a lot of exceptions not listed (both under JS and API), I would like to make a full check once, but I don't have the time. Getting the exception list, with causes, complete under JavaScript/ and API/ is hard, though as they are buried inside the prose, or the algorithm, of the specifications.

@Josh-Cena Josh-Cena requested a review from teoli2003 June 10, 2022 01:25
Copy link
Contributor

@teoli2003 teoli2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much. I've listed the three conditions for an exception as a list (we usually do this).

Let's merge this. If we discover more problems we always can fix them in follow-ups!

@teoli2003 teoli2003 merged commit d3e204f into mdn:main Jun 10, 2022
@Josh-Cena Josh-Cena deleted the fix-finalizationregistry branch June 10, 2022 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with "FinalizationRegistry.prototype.register()": possible values for heldValue aren't mentioned
2 participants