Closed littledan closed 4 years ago
Although, it's not a registry of finalizers; it's a registry of objects for one finalizer :-/
@ljharb It's hard for me to interpret this comment. Do you have a name you'd suggest? Are you OK with FinalizationRegistry
?
After some more discussion, FinalizationRegistry
seems to be acceptable - it's a registry of an object (with an optional heldValue and an optional unregister token), for finalization, and if the registry dies, i'd expect the finalization not to be performed.
In TC39, we agreed to "contingent consensus" on the name FinalizationRegistry: We're tentatively going with this name, but anyone who develops concerns should raise them on this issue. The understanding is that some implementations may ship the name FinalizationRegistry soon, if no concerns are heard.
The name change has landed weeks ago, and I haven't heard any concerns, so I'm closing this issue as resolved.
When discussing "independent lifetimes" for
FinalizationGroups
, @kmiller68 suggested that a different name could imply independent lifetimes more clearly. An "observer" seems to be more reliable than whatFinalizationGroups
provide. @erights suggested thatFinalizationRegistry
makes it clear that, when the registry goes away, we can't expect anything from it (moreso thanFinalizationHandler
). @ljharb agreed thatFinalizationRegistry
makes more sense thanFinalizationGroup
, given that there's only one callback (not a group of callbacks).Does anyone have any concerns about renaming to
FinalizationRegistry
? Or any other name to propose?