diff --git a/spec.html b/spec.html index 2237c3ae6b..0fb22d160e 100644 --- a/spec.html +++ b/spec.html @@ -12558,11 +12558,14 @@

1. Assert: _finalizationRegistry_ has [[Cells]] and [[CleanupCallback]] internal slots. 1. Let _callback_ be _finalizationRegistry_.[[CleanupCallback]]. - 1. While _finalizationRegistry_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is ~empty~, an implementation may perform the following steps: - 1. Choose any such _cell_. - 1. Remove _cell_ from _finalizationRegistry_.[[Cells]]. - 1. Perform ? HostCallJobCallback(_callback_, *undefined*, « _cell_.[[HeldValue]] »). - 1. Return ~unused~. + 1. Repeat, + 1. Let _candidates_ be a List whose elements are the elements of _finalizationRegistry_.[[Cells]] whose [[WeakRefTarget]] is ~empty~. + 1. If _candidates_ is empty, return ~unused~. + 1. Optionally, perform the following steps: + 1. Let _cell_ be an element chosen from _candidates_ in an implementation-defined manner. + 1. Remove _cell_ from _finalizationRegistry_.[[Cells]]. + 1. Perform ? HostCallJobCallback(_callback_, *undefined*, « _cell_.[[HeldValue]] »). + 1. Optionally, return ~unused~.