From 0635793819697636f062058fd89dc7f431853843 Mon Sep 17 00:00:00 2001 From: Shu-yu Guo Date: Wed, 17 Mar 2021 14:39:07 -0700 Subject: [PATCH] Normative: Use HostJobCallbacks for FinalizationRegistry callbacks (#2316) This aligns FinalizationRegistry callbacks with Promise callbacks in allowing web browsers to perform additional steps to save and restore the correct incumbent settings object. --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 6c89e5e169..0405d7f096 100644 --- a/spec.html +++ b/spec.html @@ -10171,7 +10171,7 @@

CleanupFinalizationRegistry ( _finalizationRegistry_ )

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 ? Call(_callback_, *undefined*, « _cell_.[[HeldValue]] »). + 1. Perform ? HostCallJobCallback(_callback_, *undefined*, « _cell_.[[HeldValue]] »). 1. Return NormalCompletion(*undefined*). @@ -37054,7 +37054,7 @@

FinalizationRegistry ( _cleanupCallback_ )

1. Let _finalizationRegistry_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%FinalizationRegistry.prototype%"*, « [[Realm]], [[CleanupCallback]], [[Cells]] »). 1. Let _fn_ be the active function object. 1. Set _finalizationRegistry_.[[Realm]] to _fn_.[[Realm]]. - 1. Set _finalizationRegistry_.[[CleanupCallback]] to _cleanupCallback_. + 1. Set _finalizationRegistry_.[[CleanupCallback]] to HostMakeJobCallback(_cleanupCallback_). 1. Set _finalizationRegistry_.[[Cells]] to a new empty List. 1. Return _finalizationRegistry_.