NativeFinalizer
and Finalizer
: Should calling detach
throw an error instead of be a no-op if nothing is detached?
#56632
Labels
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
triage-automation
See https://github.com/dart-lang/ecosystem/tree/main/pkgs/sdk_triage_bot.
type-enhancement
A request for a change that isn't a bug
Originally posted by @mkustermann in #56227 (comment)
Changing it now, would be a breaking change.
Also, it would mean that code racing with the GC to detach/run the finalizer if you only hold on to the detach key would start throwing if the finalizer is run first. Arguably, such code is likely broken.
I don't remember if we discussed this, and if we made it a no-op for a specific reason. (I don't see any discussion on https://dart-review.googlesource.com/c/sdk/+/238086.) Maybe @lrhn remembers.
cc @rakudrama @sigmundch for
Finalizer
on JS backend.The text was updated successfully, but these errors were encountered: