-
Notifications
You must be signed in to change notification settings - Fork 22.7k
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
Conversation
Preview URLs
FlawsNone! 🎉 External URLsURL: No new external URLs URL: No new external URLs URL: No new external URLs (this comment was updated 2022-06-10 05:33:13.915514) |
There was a problem hiding this 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?
files/en-us/web/javascript/reference/global_objects/finalizationregistry/unregister/index.md
Outdated
Show resolved
Hide resolved
|
||
### Return value | ||
|
||
`undefined`. | ||
`true` if at least one cell was unregistered; `false` if no cell was unregistered. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
files/en-us/web/javascript/reference/global_objects/finalizationregistry/register/index.md
Show resolved
Hide resolved
files/en-us/web/javascript/reference/global_objects/finalizationregistry/unregister/index.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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!
Summary
Motivation
Fix #13695
Supporting details
Related issues
Metadata