Skip to content

Commit

Permalink
more return type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra committed Nov 30, 2021
1 parent 77dc5da commit d4b1dce
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -12073,7 +12073,7 @@ <h1>
HostEnqueuePromiseJob (
_job_: a Job Abstract Closure,
_realm_: a Realm Record or *null*,
)
): a Completion Record
</h1>
<dl class="header">
<dt>description</dt>
Expand All @@ -12094,7 +12094,7 @@ <h1>
</emu-clause>

<emu-clause id="sec-initializehostdefinedrealm" type="abstract operation">
<h1>InitializeHostDefinedRealm ( )</h1>
<h1>InitializeHostDefinedRealm ( ): ~unused~</h1>
<dl class="header">
</dl>

Expand All @@ -12110,7 +12110,7 @@ <h1>InitializeHostDefinedRealm ( )</h1>
1. Perform SetRealmGlobalObject(_realm_, _global_, _thisValue_).
1. Let _globalObj_ be ? SetDefaultGlobalBindings(_realm_).
1. Create any host-defined global object properties on _globalObj_.
1. Return NormalCompletion(~empty~).
1. Return ~unused~.
</emu-alg>
</emu-clause>

Expand Down Expand Up @@ -12190,7 +12190,7 @@ <h1>Agents</h1>
</emu-note>

<emu-clause id="sec-agentsignifier" type="abstract operation">
<h1>AgentSignifier ( )</h1>
<h1>AgentSignifier ( ): unknown</h1>
<dl class="header">
</dl>
<emu-alg>
Expand All @@ -12200,7 +12200,7 @@ <h1>AgentSignifier ( )</h1>
</emu-clause>

<emu-clause id="sec-agentcansuspend" type="abstract operation">
<h1>AgentCanSuspend ( )</h1>
<h1>AgentCanSuspend ( ): a Boolean</h1>
<dl class="header">
</dl>
<emu-alg>
Expand Down Expand Up @@ -12358,7 +12358,7 @@ <h1>Execution</h1>
1. Set _ref_.[[WeakRefTarget]] to ~empty~.
1. For each FinalizationRegistry _fg_ such that _fg_.[[Cells]] contains a Record _cell_ such that _cell_.[[WeakRefTarget]] is _obj_, do
1. Set _cell_.[[WeakRefTarget]] to ~empty~.
1. Optionally, perform ! HostEnqueueFinalizationRegistryCleanupJob(_fg_).
1. Optionally, perform HostEnqueueFinalizationRegistryCleanupJob(_fg_).
1. For each WeakMap _map_ such that _map_.[[WeakMapData]] contains a Record _r_ such that _r_.[[Key]] is _obj_, do
1. Set _r_.[[Key]] to ~empty~.
1. Set _r_.[[Value]] to ~empty~.
Expand Down Expand Up @@ -12388,44 +12388,46 @@ <h1>Host Hooks</h1>
<h1>
HostEnqueueFinalizationRegistryCleanupJob (
_finalizationRegistry_: a FinalizationRegistry,
)
): ~unused~
</h1>
<dl class="header">
</dl>
<p>Let _cleanupJob_ be a new Job Abstract Closure with no parameters that captures _finalizationRegistry_ and performs the following steps when called:</p>
<emu-alg>
1. Let _cleanupResult_ be CleanupFinalizationRegistry(_finalizationRegistry_).
1. If _cleanupResult_ is an abrupt completion, perform any host-defined steps for reporting the error.
1. Return NormalCompletion(~empty~).
1. Return ~unused~.
</emu-alg>
<p>An implementation of HostEnqueueFinalizationRegistryCleanupJob schedules _cleanupJob_ to be performed at some future time, if possible. It must also conform to the requirements in <emu-xref href="#sec-jobs"></emu-xref>.</p>
</emu-clause>
</emu-clause>
</emu-clause>

<emu-clause id="sec-clear-kept-objects" type="abstract operation">
<h1>ClearKeptObjects ( )</h1>
<h1>ClearKeptObjects ( ): ~unused~</h1>
<dl class="header">
<dt>description</dt>
<dd>ECMAScript implementations are expected to call ClearKeptObjects when a synchronous sequence of ECMAScript executions completes.</dd>
</dl>
<emu-alg>
1. Let _agentRecord_ be the surrounding agent's Agent Record.
1. Set _agentRecord_.[[KeptAlive]] to a new empty List.
1. Return ~unused~.
</emu-alg>
</emu-clause>

<emu-clause id="sec-addtokeptobjects" type="abstract operation">
<h1>
AddToKeptObjects (
_object_: an Object,
)
): ~unused~
</h1>
<dl class="header">
</dl>
<emu-alg>
1. Let _agentRecord_ be the surrounding agent's Agent Record.
1. Append _object_ to _agentRecord_.[[KeptAlive]].
1. Return ~unused~.
</emu-alg>
<emu-note>
When the abstract operation AddToKeptObjects is called with a target object reference, it adds the target to a list that will point strongly at the target until ClearKeptObjects is called.
Expand All @@ -12436,7 +12438,7 @@ <h1>
<h1>
CleanupFinalizationRegistry (
_finalizationRegistry_: a FinalizationRegistry,
)
): a Completion Record normally containing ~unused~
</h1>
<dl class="header">
</dl>
Expand All @@ -12447,7 +12449,7 @@ <h1>
1. Choose any such _cell_.
1. Remove _cell_ from _finalizationRegistry_.[[Cells]].
1. Perform ? HostCallJobCallback(_callback_, *undefined*, &laquo; _cell_.[[HeldValue]] &raquo;).
1. Return NormalCompletion(~empty~).
1. Return NormalCompletion(~unused~).
</emu-alg>
</emu-clause>
</emu-clause>
Expand Down Expand Up @@ -42473,7 +42475,7 @@ <h1>WeakRef ( _target_ )</h1>
1. If NewTarget is *undefined*, throw a *TypeError* exception.
1. If Type(_target_) is not Object, throw a *TypeError* exception.
1. Let _weakRef_ be ? OrdinaryCreateFromConstructor(NewTarget, *"%WeakRef.prototype%"*, &laquo; [[WeakRefTarget]] &raquo;).
1. Perform ! AddToKeptObjects(_target_).
1. Perform AddToKeptObjects(_target_).
1. Set _weakRef_.[[WeakRefTarget]] to _target_.
1. Return _weakRef_.
</emu-alg>
Expand Down Expand Up @@ -42565,7 +42567,7 @@ <h1>
<emu-alg>
1. Let _target_ be _weakRef_.[[WeakRefTarget]].
1. If _target_ is not ~empty~, then
1. Perform ! AddToKeptObjects(_target_).
1. Perform AddToKeptObjects(_target_).
1. Return _target_.
1. Return *undefined*.
</emu-alg>
Expand Down

0 comments on commit d4b1dce

Please sign in to comment.