Name Description Size Coverage
cleanup-prevented-with-reference.optional.any.js --- esid: sec-finalization-registry.prototype.cleanupSome info: | FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) 1. Let finalizationRegistry be the this value. 2. If Type(finalizationRegistry) is not Object, throw a TypeError exception. 3. If finalizationRegistry does not have a [[Cells]] internal slot, throw a TypeError exception. 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. --- 1747 -
cleanup-prevented-with-unregister.optional.any.js --- esid: sec-finalization-registry.prototype.cleanupSome info: | FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) 1. Let finalizationRegistry be the this value. 2. If Type(finalizationRegistry) is not Object, throw a TypeError exception. 3. If finalizationRegistry does not have a [[Cells]] internal slot, throw a TypeError exception. 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. FinalizationRegistry.prototype.unregister ( unregisterToken ) 1. Let removed be false. 2. For each Record { [[Target]], [[Holdings]], [[UnregisterToken]] } cell that is an element of finalizationRegistry.[[Cells]], do a. If SameValue(cell.[[UnregisterToken]], unregisterToken) is true, then i. Remove cell from finalizationRegistry.[[Cells]]. ii. Set removed to true. 3. Return removed. --- 2066 -
finalizationregistry-cleanupCallback-gets-a-microtask.optional.any.js --- esid: sec-finalization-registry-target info: | FinalizationRegistry ( cleanupCallback ) Execution At any time, if a set of objects S is not live, an ECMAScript implementation may perform the following steps atomically: For each obj of S, do For each WeakRef ref such that ref.[[WeakRefTarget]] is obj, do Set ref.[[WeakRefTarget]] to empty. For each FinalizationRegistry fg such that fg.[[Cells]] contains cell, such that cell.[[WeakRefTarget]] is obj, Set cell.[[WeakRefTarget]] to empty. Optionally, perform ! HostCleanupFinalizationRegistry(fg). HostCleanupFinalizationRegistry(finalizationRegistry) HostCleanupFinalizationRegistry is an implementation-defined abstract operation that is expected to call CleanupFinalizationRegistry(finalizationRegistry) at some point in the future, if possible. The host's responsibility is to make this call at a time which does not interrupt synchronous ECMAScript code execution. --- 2111 -
finalizationregistry-cleanupCallback-throws-onerror-interaction.optional.window.js --- esid: sec-finalization-registry-target info: | FinalizationRegistry ( cleanupCallback ) CleanupFinalizationRegistry ( finalizationRegistry [ , callback ] ) The following steps are performed: Assert: finalizationRegistry has [[Cells]] and [[CleanupCallback]] internal slots. If callback is not present or undefined, set callback to finalizationRegistry.[[CleanupCallback]]. While finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is empty, then an implementation may perform the following steps, Choose any such cell. Remove cell from finalizationRegistry.[[Cells]]. Perform ? Call(callback, undefined, « cell.[[HeldValue]] »). Return NormalCompletion(undefined). EDITOR'S NOTE When called from HostCleanupFinalizationRegistry, if calling the callback throws an error, this will be caught within the RunJobs algorithm and reported to the host. HTML does not apply the RunJobs algorithm, but will also report the error, which may call window.onerror. --- 2648 -
gc-has-one-chance-to-call-cleanupCallback-queueMicrotask.optional.any.js --- esid: sec-finalization-registry-target info: | FinalizationRegistry ( cleanupCallback ) FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) ... 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. Execution At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically: 1. For each WeakRef ref such that ref.[[Target]] is obj, a. Set ref.[[Target]] to empty. 2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj, a. Set cell.[[Target]] to empty. b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry). --- 3834 -
gc-has-one-chance-to-call-cleanupCallback-queueMicrotaskMutationObserver.optional.window.js --- esid: sec-finalization-registry-target info: | FinalizationRegistry ( cleanupCallback ) FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) ... 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. Execution At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically: 1. For each WeakRef ref such that ref.[[Target]] is obj, a. Set ref.[[Target]] to empty. 2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj, a. Set cell.[[Target]] to empty. b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry). --- 4095 -
gc-has-one-chance-to-call-cleanupCallback.optional.any.js --- esid: sec-finalization-registry-target info: | FinalizationRegistry ( cleanupCallback ) FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) ... 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. Execution At any time, if an object obj is not live, an ECMAScript implementation may perform the following steps atomically: 1. For each WeakRef ref such that ref.[[Target]] is obj, a. Set ref.[[Target]] to empty. 2. For each FinalizationRegistry finalizationRegistry such that finalizationRegistry.[[Cells]] contains cell, such that cell.[[Target]] is obj, a. Set cell.[[Target]] to empty. b. Optionally, perform ! HostCleanupFinalizationRegistry(finalizationRegistry). --- 3650 -
holdings-multiple-values.optional.any.js --- esid: sec-properties-of-the-finalization-registry-constructor info: | FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) 1. Let finalizationRegistry be the this value. ... 5. Perform ! CleanupFinalizationRegistry(finalizationRegistry, callback). ... CleanupFinalizationRegistry ( finalizationRegistry [ , callback ] ) ... 3. While finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is ~empty~, then an implementation may perform the following steps, a. Choose any such cell. b. Remove cell from finalizationRegistry.[[Cells]]. c. Perform ? Call(callback, undefined, << cell.[[HeldValue]] >>). --- 2470 -
reentrancy.optional.any.js --- esid: sec-properties-of-the-finalization-registry-constructor --- 1480 -
resources -
return-undefined-with-gc.optional.any.js --- esid: sec-finalization-registry.prototype.cleanupSome info: | FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) 1. Let finalizationRegistry be the this value. 2. If Type(finalizationRegistry) is not Object, throw a TypeError exception. 3. If finalizationRegistry does not have a [[Cells]] internal slot, throw a TypeError exception. 4. If callback is not undefined and IsCallable(callback) is false, throw a TypeError exception. 5. Perform ? CleanupFinalizationRegistry(finalizationRegistry, callback). 6. Return undefined. --- 2652 -
unregister-cleaned-up-cell.optional.any.js --- esid: sec-finalization-registry.prototype.unregister info: | FinalizationRegistry.prototype.cleanupSome ( [ callback ] ) 1. Let finalizationRegistry be the this value. ... 5. Perform ! CleanupFinalizationRegistry(finalizationRegistry, callback). ... CleanupFinalizationRegistry ( finalizationRegistry [ , callback ] ) ... 3. While finalizationRegistry.[[Cells]] contains a Record cell such that cell.[[WeakRefTarget]] is ~empty~, then an implementation may perform the following steps, a. Choose any such cell. b. Remove cell from finalizationRegistry.[[Cells]]. c. Perform ? Call(callback, undefined, << cell.[[HeldValue]] >>). ... FinalizationRegistry.prototype.unregister ( unregisterToken ) 1. Let removed be false. 2. For each Record { [[Target]], [[Holdings]], [[UnregisterToken]] } cell that is an element of finalizationRegistry.[[Cells]], do a. If SameValue(cell.[[UnregisterToken]], unregisterToken) is true, then i. Remove cell from finalizationRegistry.[[Cells]]. ii. Set removed to true. 3. Return removed. --- 2300 -