Skip to content

Commit

Permalink
Move _cancel and _pull to be truly internal methods
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Mar 3, 2016
1 parent 55eb984 commit 0aa9a98
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ called with argument <var>reason</var>, it performs the following steps:
1. If _stream_@[[state]] is `"closed"`, return a new promise resolved with *undefined*.
1. If _stream_@[[state]] is `"errored"`, return a new promise rejected with _stream_@[[storedError]].
1. Perform ReadableStreamClose(_stream_).
1. Let _sourceCancelPromise_ be _stream_@[[readableStreamController]]@[[_cancel]](_reason_).
1. Let _sourceCancelPromise_ be _stream_@[[readableStreamController]].[[\Cancel]](_reason_).
1. Return the result of transforming _sourceCancelPromise_ by a fulfillment handler that returns *undefined*.
</emu-alg>

Expand Down Expand Up @@ -1286,7 +1286,7 @@ Instances of <code>ReadableStreamBYOBReader</code> are created with the internal
1. If _stream_@[[state]] is `"closed"`, return a new promise resolved with CreateIterResultObject(*undefined*, *true*).
1. If _stream_@[[state]] is `"errored"`, return a new promise rejected with _stream_@[[storedError]].
1. Assert: _stream_@[[state]] is `"readable"`.
1. Return _stream_@[[readableStreamController]]@[[_pull]]().
1. Return _stream_@[[readableStreamController]].[[Pull]]().
</emu-alg>

<h3 id="rs-default-controller-class" lt="ReadableStreamDefaultController">Class <code>ReadableStreamDefaultController</code></h3>
Expand All @@ -1312,9 +1312,6 @@ it would look like
close()
enqueue(chunk)
error(e)

_cancel(reason)
_pull()
}
</code></pre>

Expand Down Expand Up @@ -1459,22 +1456,20 @@ Instances of <code>ReadableStreamDefaultController</code> are created with the i
1. Perform ReadableStreamDefaultControllerError(*this*, _e_).
</emu-alg>

<h5 id="rs-default-controller-private-cancel">_cancel(reason)</h5>
<h4 id="rs-default-controller-internal-methods">Readable Stream Default Controller Internal Methods</h4>

<div class="note">
The <code>_cancel</code> method is only for controller implementations.
</div>
The following are additional internal methods implemented by each <code>ReadableStreamDefaultController</code> instance.
They are similar to the supporting abstract operations in the following section, but are in method form to allow
polymorphic dispatch from the readable stream implementation to either these or their counterparts for BYOB controllers.

<h5 id="rs-default-controller-private-cancel">\[[Cancel]](reason)</h5>

<emu-alg>
1. Set *this*@[[queue]] to a new empty List.
1. Return PromiseInvokeOrNoop(*this*@[[underlyingSource]], `"cancel"`, «_reason_»)
</emu-alg>

<h5 id="rs-default-controller-private-pull">_pull()</h5>

<div class="note">
The <code>_pull</code> method is only for controller implementations.
</div>
<h5 id="rs-default-controller-private-pull">\[[Pull]]()</h5>

<emu-alg>
1. Let _stream_ be *this*@[[controlledReadableStream]].
Expand Down Expand Up @@ -1706,9 +1701,6 @@ If one were to write the <code>ReadableStreamBYOBController</code> class in some
close()
enqueue(chunk)
error(e)

_cancel(reason)
_pull()
}
</code></pre>

Expand Down Expand Up @@ -1883,11 +1875,14 @@ table:
1. Perform ReadableStreamBYOBControllerError(*this*, _e_).
</emu-alg>

<h5 id="rs-byob-controller-private-cancel">_cancel(reason)</h5>
<h4 id="rs-byob-controller-internal-methods">Readable Stream BYOB Controller Internal Methods</h4>

<div class="note">
The <code>_cancel</code> method is only for controller implementations.
</div>
The following are additional internal methods implemented by each <code>ReadableStreamBYOBController</code> instance.
They are similar to the supporting abstract operations in the following section, but are in method form to allow
polymorphic dispatch from the readable stream implementation to either these or their counterparts for default
controllers.

<h5 id="rs-byob-controller-private-cancel">\[[Cancel]](reason)</h5>

<emu-alg>
1. If *this*@[[pendingPullIntos]] is not empty,
Expand All @@ -1898,11 +1893,7 @@ table:
1. Return PromiseInvokeOrNoop(*this*@[[underlyingByteSource]], `"cancel"`, «_reason_»)
</emu-alg>

<h5 id="rs-byob-controller-private-pull">_pull()</h5>

<div class="note">
The <code>_pull</code> method is only for controller implementations.
</div>
<h5 id="rs-byob-controller-private-pull">\[[Pull]]()</h5>

<emu-alg>
1. Let _stream_ be *this*@[[controlledReadableStream]].
Expand Down

0 comments on commit 0aa9a98

Please sign in to comment.