Skip to content

Commit 38c1329

Browse files
committed
Reorder methods to match tc39/ecma262#3000
1 parent e37aa9a commit 38c1329

File tree

1 file changed

+75
-75
lines changed

1 file changed

+75
-75
lines changed

spec.emu

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4520,41 +4520,6 @@ contributors: Ron Buckton, Ecma International
45204520
<li>does not have a [[DisposableState]] internal slot or any of the other internal slots of DisposableStack instances.</li>
45214521
</ul>
45224522

4523-
<emu-clause id="sec-get-disposablestack.prototype.disposed">
4524-
<h1>get DisposableStack.prototype.disposed</h1>
4525-
<p>`DisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
4526-
<emu-alg>
4527-
1. Let _disposableStack_ be the *this* value.
4528-
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4529-
1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *true*.
4530-
1. Otherwise, return *false*.
4531-
</emu-alg>
4532-
</emu-clause>
4533-
4534-
<emu-clause id="sec-disposablestack.prototype.dispose">
4535-
<h1>DisposableStack.prototype.dispose ()</h1>
4536-
<p>This method performs the following steps when called:</p>
4537-
<emu-alg>
4538-
1. Let _disposableStack_ be the *this* value.
4539-
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4540-
1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *undefined*.
4541-
1. Set _disposableStack_.[[DisposableState]] to ~disposed~.
4542-
1. Return DisposeResources(_disposableStack_.[[DisposeCapability]], NormalCompletion(*undefined*)).
4543-
</emu-alg>
4544-
</emu-clause>
4545-
4546-
<emu-clause id="sec-disposablestack.prototype.use">
4547-
<h1>DisposableStack.prototype.use( _value_ )</h1>
4548-
<p>This method performs the following steps when called:</p>
4549-
<emu-alg>
4550-
1. Let _disposableStack_ be the *this* value.
4551-
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4552-
1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4553-
1. Perform ? AddDisposableResource(_disposableStack_.[[DisposeCapability]], _value_, ~sync-dispose~).
4554-
1. Return _value_.
4555-
</emu-alg>
4556-
</emu-clause>
4557-
45584523
<emu-clause id="sec-disposablestack.prototype.adopt">
45594524
<h1>DisposableStack.prototype.adopt( _value_, _onDispose_ )</h1>
45604525
<p>This method performs the following steps when called:</p>
@@ -4584,6 +4549,29 @@ contributors: Ron Buckton, Ecma International
45844549
</emu-alg>
45854550
</emu-clause>
45864551

4552+
<emu-clause id="sec-disposablestack.prototype.dispose">
4553+
<h1>DisposableStack.prototype.dispose ()</h1>
4554+
<p>This method performs the following steps when called:</p>
4555+
<emu-alg>
4556+
1. Let _disposableStack_ be the *this* value.
4557+
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4558+
1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *undefined*.
4559+
1. Set _disposableStack_.[[DisposableState]] to ~disposed~.
4560+
1. Return DisposeResources(_disposableStack_.[[DisposeCapability]], NormalCompletion(*undefined*)).
4561+
</emu-alg>
4562+
</emu-clause>
4563+
4564+
<emu-clause id="sec-get-disposablestack.prototype.disposed">
4565+
<h1>get DisposableStack.prototype.disposed</h1>
4566+
<p>`DisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
4567+
<emu-alg>
4568+
1. Let _disposableStack_ be the *this* value.
4569+
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4570+
1. If _disposableStack_.[[DisposableState]] is ~disposed~, return *true*.
4571+
1. Otherwise, return *false*.
4572+
</emu-alg>
4573+
</emu-clause>
4574+
45874575
<emu-clause id="sec-disposablestack.prototype.move">
45884576
<h1>DisposableStack.prototype.move()</h1>
45894577
<p>This method performs the following steps when called:</p>
@@ -4600,6 +4588,18 @@ contributors: Ron Buckton, Ecma International
46004588
</emu-alg>
46014589
</emu-clause>
46024590

4591+
<emu-clause id="sec-disposablestack.prototype.use">
4592+
<h1>DisposableStack.prototype.use( _value_ )</h1>
4593+
<p>This method performs the following steps when called:</p>
4594+
<emu-alg>
4595+
1. Let _disposableStack_ be the *this* value.
4596+
1. Perform ? RequireInternalSlot(_disposableStack_, [[DisposableState]]).
4597+
1. If _disposableStack_.[[DisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4598+
1. Perform ? AddDisposableResource(_disposableStack_.[[DisposeCapability]], _value_, ~sync-dispose~).
4599+
1. Return _value_.
4600+
</emu-alg>
4601+
</emu-clause>
4602+
46034603
<emu-clause id="sec-disposablestack.prototype-@@dispose">
46044604
<h1>DisposableStack.prototype [ @@dispose ] ()</h1>
46054605
<p>The initial value of the @@dispose property is %DisposableStack.prototype.dispose%, defined in <emu-xref href="#sec-disposablestack.prototype.dispose"></emu-xref>.</p>
@@ -4714,14 +4714,32 @@ contributors: Ron Buckton, Ecma International
47144714
<li>does not have an [[AsyncDisposableState]] internal slot or any of the other internal slots of AsyncDisposableStack instances.</li>
47154715
</ul>
47164716

4717-
<emu-clause id="sec-get-asyncdisposablestack.prototype.disposed">
4718-
<h1>get AsyncDisposableStack.prototype.disposed</h1>
4719-
<p>`AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
4717+
<emu-clause id="sec-asyncdisposablestack.prototype.adopt">
4718+
<h1>AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )</h1>
4719+
<p>This method performs the following steps when called:</p>
47204720
<emu-alg>
47214721
1. Let _asyncDisposableStack_ be the *this* value.
47224722
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4723-
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*.
4724-
1. Otherwise, return *false*.
4723+
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4724+
1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
4725+
1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called:
4726+
1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »).
4727+
1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »).
4728+
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _F_).
4729+
1. Return _value_.
4730+
</emu-alg>
4731+
</emu-clause>
4732+
4733+
<emu-clause id="sec-asyncdisposablestack.prototype.defer">
4734+
<h1>AsyncDisposableStack.prototype.defer( _onDisposeAsync_ )</h1>
4735+
<p>This method performs the following steps when called:</p>
4736+
<emu-alg>
4737+
1. Let _asyncDisposableStack_ be the *this* value.
4738+
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4739+
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4740+
1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
4741+
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_).
4742+
1. Return *undefined*.
47254743
</emu-alg>
47264744
</emu-clause>
47274745

@@ -4745,44 +4763,14 @@ contributors: Ron Buckton, Ecma International
47454763
</emu-alg>
47464764
</emu-clause>
47474765

4748-
<emu-clause id="sec-asyncdisposablestack.prototype.use">
4749-
<h1>AsyncDisposableStack.prototype.use( _value_ )</h1>
4750-
<p>This method performs the following steps when called:</p>
4751-
<emu-alg>
4752-
1. Let _asyncDisposableStack_ be the *this* value.
4753-
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4754-
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4755-
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~).
4756-
1. Return _value_.
4757-
</emu-alg>
4758-
</emu-clause>
4759-
4760-
<emu-clause id="sec-asyncdisposablestack.prototype.adopt">
4761-
<h1>AsyncDisposableStack.prototype.adopt( _value_, _onDisposeAsync_ )</h1>
4762-
<p>This method performs the following steps when called:</p>
4763-
<emu-alg>
4764-
1. Let _asyncDisposableStack_ be the *this* value.
4765-
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4766-
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4767-
1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
4768-
1. Let _closure_ be a new Abstract Closure with no parameters that captures _value_ and _onDisposeAsync_ and performs the following steps when called:
4769-
1. Return ? Call(_onDisposeAsync_, *undefined*, « _value_ »).
4770-
1. Let _F_ be CreateBuiltinFunction(_closure_, 0, *""*, « »).
4771-
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _F_).
4772-
1. Return _value_.
4773-
</emu-alg>
4774-
</emu-clause>
4775-
4776-
<emu-clause id="sec-asyncdisposablestack.prototype.defer">
4777-
<h1>AsyncDisposableStack.prototype.defer( _onDisposeAsync_ )</h1>
4778-
<p>This method performs the following steps when called:</p>
4766+
<emu-clause id="sec-get-asyncdisposablestack.prototype.disposed">
4767+
<h1>get AsyncDisposableStack.prototype.disposed</h1>
4768+
<p>`AsyncDisposableStack.prototype.disposed` is an accessor property whose set accessor function is *undefined*. Its get accessor function performs the following steps:</p>
47794769
<emu-alg>
47804770
1. Let _asyncDisposableStack_ be the *this* value.
47814771
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4782-
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4783-
1. If IsCallable(_onDisposeAsync_) is *false*, throw a *TypeError* exception.
4784-
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], *undefined*, ~async-dispose~, _onDisposeAsync_).
4785-
1. Return *undefined*.
4772+
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, return *true*.
4773+
1. Otherwise, return *false*.
47864774
</emu-alg>
47874775
</emu-clause>
47884776

@@ -4802,6 +4790,18 @@ contributors: Ron Buckton, Ecma International
48024790
</emu-alg>
48034791
</emu-clause>
48044792

4793+
<emu-clause id="sec-asyncdisposablestack.prototype.use">
4794+
<h1>AsyncDisposableStack.prototype.use( _value_ )</h1>
4795+
<p>This method performs the following steps when called:</p>
4796+
<emu-alg>
4797+
1. Let _asyncDisposableStack_ be the *this* value.
4798+
1. Perform ? RequireInternalSlot(_asyncDisposableStack_, [[AsyncDisposableState]]).
4799+
1. If _asyncDisposableStack_.[[AsyncDisposableState]] is ~disposed~, throw a *ReferenceError* exception.
4800+
1. Perform ? AddDisposableResource(_asyncDisposableStack_.[[DisposeCapability]], _value_, ~async-dispose~).
4801+
1. Return _value_.
4802+
</emu-alg>
4803+
</emu-clause>
4804+
48054805
<emu-clause id="sec-asyncdisposablestack.prototype-@@asyncDispose">
48064806
<h1>AsyncDisposableStack.prototype [ @@asyncDispose ] ()</h1>
48074807
<p>The initial value of the @@asyncDispose property is %AsyncDisposableStack.prototype.disposeAsync%, defined in <emu-xref href="#sec-asyncdisposablestack.prototype.disposeAsync"></emu-xref>.</p>

0 commit comments

Comments
 (0)