Skip to content

Commit

Permalink
Deploying to gh-pages from @ 3d6550a 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Apr 10, 2024
1 parent 03d989e commit 95176d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pr/219/index.html
Expand Up @@ -3528,7 +3528,7 @@ <h1><span class="secnum">2.1.7</span> Dispose ( <var>V</var>, <var>hint</var>, <
<emu-clause id="sec-disposeresources" type="abstract operation" aoid="DisposeResources">
<h1><span class="secnum">2.1.8</span> DisposeResources ( <var>disposeCapability</var>, <var>completion</var> )</h1>
<p>The abstract operation DisposeResources takes arguments <var>disposeCapability</var> (a <emu-xref href="#sec-disposecapability-records" id="_ref_48"><a href="#sec-disposecapability-records">DisposeCapability Record</a></emu-xref>) and <var>completion</var> (a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">Completion Record</a></emu-xref>) and returns a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">Completion Record</a></emu-xref>. It performs the following steps when called:</p>
<emu-alg><ol><li>Let <var>needsAwait</var> be <emu-val>false</emu-val>.</li><li>Let <var>hasAwaited</var> be <emu-val>false</emu-val>.</li><li>For each element <var>resource</var> of <var>disposeCapability</var>.[[DisposableResourceStack]], in reverse list order, do<ol><li>Let <var>value</var> be <var>resource</var>.[[ResourceValue]].</li><li>Let <var>hint</var> be <var>resource</var>.[[Hint]].</li><li>Let <var>method</var> be <var>resource</var>.[[DisposeMethod]].</li><li>If <var>hint</var> is <emu-const>sync-dispose</emu-const> and <var>needsAwait</var> is <emu-val>true</emu-val> and <var>hasAwaited</var> is <emu-val>false</emu-val>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<emu-val>undefined</emu-val>).</li><li>Set <var>needsAwait</var> to <emu-val>false</emu-val>.</li><li>Set <var>hasAwaited</var> to <emu-val>false</emu-val>.</li></ol></li><li>If <var>method</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>method</var>, <var>value</var>)).</li><li>If <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> and <var>hint</var> is <emu-const>async-dispose</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<var>result</var>.[[Value]])).</li><li>Set <var>hasAwaited</var> to <emu-val>true</emu-val>.</li></ol></li><li>If <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>, then<ol><li>If <var>completion</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>, then<ol><li>Set <var>result</var> to <var>result</var>.[[Value]].</li><li>Let <var>suppressed</var> be <var>completion</var>.[[Value]].</li><li>Let <var>error</var> be a newly created <emu-val>SuppressedError</emu-val> object.</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>error</var>, <emu-val>"error"</emu-val>, <var>result</var>).</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>error</var>, <emu-val>"suppressed"</emu-val>, <var>suppressed</var>).</li><li>Set <var>completion</var> to <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>error</var>).</li></ol></li><li>Else,<ol><li>Set <var>completion</var> to <var>result</var>.</li></ol></li></ol></li><li>Else,<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>hint</var> is <emu-const>async-dispose</emu-const>.</li><li>Set <var>needsAwait</var> to <emu-val>true</emu-val>.</li><li>NOTE: This can only indicate a case where either <emu-val>null</emu-val> or <emu-val>undefined</emu-val> was the initialized value of an <code>await using</code> declaration.</li></ol></li></ol></li></ol></li><li>If <var>needsAwait</var> is <emu-val>true</emu-val> and <var>hasAwaited</var> is <emu-val>false</emu-val>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></li><li>NOTE: After <var>disposeCapability</var> has been disposed, it will never be used again. The contents of <var>disposeCapability</var>.[[DisposableResourceStack]] can be discarded in implementations, such as by garbage collection, at this point.</li><li>Set <var>disposeCapability</var>.[[DisposableResourceStack]] to a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Return <var>completion</var>.</li></ol></emu-alg>
<emu-alg><ol><li>Let <var>needsAwait</var> be <emu-val>false</emu-val>.</li><li>Let <var>hasAwaited</var> be <emu-val>false</emu-val>.</li><li>For each element <var>resource</var> of <var>disposeCapability</var>.[[DisposableResourceStack]], in reverse list order, do<ol><li>Let <var>value</var> be <var>resource</var>.[[ResourceValue]].</li><li>Let <var>hint</var> be <var>resource</var>.[[Hint]].</li><li>Let <var>method</var> be <var>resource</var>.[[DisposeMethod]].</li><li>If <var>hint</var> is <emu-const>sync-dispose</emu-const> and <var>needsAwait</var> is <emu-val>true</emu-val> and <var>hasAwaited</var> is <emu-val>false</emu-val>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<emu-val>undefined</emu-val>).</li><li>Set <var>needsAwait</var> to <emu-val>false</emu-val>.</li></ol></li><li>If <var>method</var> is not <emu-val>undefined</emu-val>, then<ol><li>Let <var>result</var> be <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Call"><a href="https://tc39.es/ecma262/#sec-call">Call</a></emu-xref>(<var>method</var>, <var>value</var>)).</li><li>If <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">normal completion</a></emu-xref> and <var>hint</var> is <emu-const>async-dispose</emu-const>, then<ol><li>Set <var>result</var> to <emu-xref aoid="Completion"><a href="https://tc39.es/ecma262/#sec-completion-ao">Completion</a></emu-xref>(<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<var>result</var>.[[Value]])).</li><li>Set <var>hasAwaited</var> to <emu-val>true</emu-val>.</li></ol></li><li>If <var>result</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>, then<ol><li>If <var>completion</var> is a <emu-xref href="#sec-completion-record-specification-type"><a href="https://tc39.es/ecma262/#sec-completion-record-specification-type">throw completion</a></emu-xref>, then<ol><li>Set <var>result</var> to <var>result</var>.[[Value]].</li><li>Let <var>suppressed</var> be <var>completion</var>.[[Value]].</li><li>Let <var>error</var> be a newly created <emu-val>SuppressedError</emu-val> object.</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>error</var>, <emu-val>"error"</emu-val>, <var>result</var>).</li><li>Perform <emu-xref aoid="CreateNonEnumerableDataPropertyOrThrow"><a href="https://tc39.es/ecma262/#sec-createnonenumerabledatapropertyorthrow">CreateNonEnumerableDataPropertyOrThrow</a></emu-xref>(<var>error</var>, <emu-val>"suppressed"</emu-val>, <var>suppressed</var>).</li><li>Set <var>completion</var> to <emu-xref aoid="ThrowCompletion"><a href="https://tc39.es/ecma262/#sec-throwcompletion">ThrowCompletion</a></emu-xref>(<var>error</var>).</li></ol></li><li>Else,<ol><li>Set <var>completion</var> to <var>result</var>.</li></ol></li></ol></li><li>Else,<ol><li><emu-xref href="#assert"><a href="https://tc39.es/ecma262/#assert">Assert</a></emu-xref>: <var>hint</var> is <emu-const>async-dispose</emu-const>.</li><li>Set <var>needsAwait</var> to <emu-val>true</emu-val>.</li><li>NOTE: This can only indicate a case where either <emu-val>null</emu-val> or <emu-val>undefined</emu-val> was the initialized value of an <code>await using</code> declaration.</li></ol></li></ol></li></ol></li><li>If <var>needsAwait</var> is <emu-val>true</emu-val> and <var>hasAwaited</var> is <emu-val>false</emu-val>, then<ol><li>Perform !&nbsp;<emu-xref aoid="Await"><a href="https://tc39.es/ecma262/#await">Await</a></emu-xref>(<emu-val>undefined</emu-val>).</li></ol></li><li>NOTE: After <var>disposeCapability</var> has been disposed, it will never be used again. The contents of <var>disposeCapability</var>.[[DisposableResourceStack]] can be discarded in implementations, such as by garbage collection, at this point.</li><li>Set <var>disposeCapability</var>.[[DisposableResourceStack]] to a new empty <emu-xref href="#sec-list-and-record-specification-type"><a href="https://tc39.es/ecma262/#sec-list-and-record-specification-type">List</a></emu-xref>.</li><li>Return <var>completion</var>.</li></ol></emu-alg>
</emu-clause>
</emu-clause>
</ins>
Expand Down

0 comments on commit 95176d1

Please sign in to comment.