From e239365f013b0f308b5848133d59f00009c54b35 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 9 Apr 2026 14:02:54 -0600 Subject: [PATCH 1/3] Editorial: use idiomatic phrasing in CleanupFinalizationRegistry --- spec.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec.html b/spec.html index 2237c3ae6b..0ec2a90100 100644 --- a/spec.html +++ b/spec.html @@ -12558,10 +12558,12 @@

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. Repeat, while _finalizationRegistry_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is ~empty~, + 1. Optionally, perform the following steps: + 1. Choose any Record _cell_ in _finalizationRegistry_.[[Cells]] such that _cell_.[[WeakRefTarget]] is ~empty~. + 1. Remove _cell_ from _finalizationRegistry_.[[Cells]]. + 1. Perform ? HostCallJobCallback(_callback_, *undefined*, « _cell_.[[HeldValue]] »). + 1. Optionally, return ~unused~. 1. Return ~unused~. From fcbcf9dbfb96e1dc29e86a081c464960611288da Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 9 Apr 2026 14:44:59 -0600 Subject: [PATCH 2/3] even more normal --- spec.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec.html b/spec.html index 0ec2a90100..3b3e606a45 100644 --- a/spec.html +++ b/spec.html @@ -12558,13 +12558,14 @@

1. Assert: _finalizationRegistry_ has [[Cells]] and [[CleanupCallback]] internal slots. 1. Let _callback_ be _finalizationRegistry_.[[CleanupCallback]]. - 1. Repeat, while _finalizationRegistry_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is ~empty~, + 1. Repeat, + 1. Let _candidates_ be a List whose elements are the elements of _finalizationRegistry_.[[Cells]] such that, for each element _cell_, _cell.[[WeakRefTarget]] is ~empty~. + 1. If _candidates_ is empty, return ~unused~. 1. Optionally, perform the following steps: - 1. Choose any Record _cell_ in _finalizationRegistry_.[[Cells]] such that _cell_.[[WeakRefTarget]] is ~empty~. + 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~. - 1. Return ~unused~. From dee934aba6633704189f925f73ffc519fa157b4c Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Thu, 9 Apr 2026 14:54:50 -0600 Subject: [PATCH 3/3] we have precedent for this I swear --- spec.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec.html b/spec.html index 3b3e606a45..0fb22d160e 100644 --- a/spec.html +++ b/spec.html @@ -12559,7 +12559,7 @@

1. Assert: _finalizationRegistry_ has [[Cells]] and [[CleanupCallback]] internal slots. 1. Let _callback_ be _finalizationRegistry_.[[CleanupCallback]]. 1. Repeat, - 1. Let _candidates_ be a List whose elements are the elements of _finalizationRegistry_.[[Cells]] such that, for each element _cell_, _cell.[[WeakRefTarget]] is ~empty~. + 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.