- From: Mattias Buelens <notifications@github.com>
- Date: Mon, 12 Jul 2021 13:23:25 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1130/review/704489893@github.com>
@MattiasBuelens requested changes on this pull request.
>
-<p algorithm>A {{ReadableStream}} |stream| <dfn export for="ReadableStream" lt="need more
-data|needs more data">needs more data</dfn> if |stream| is [=ReadableStream/readable=] and !
-[$ReadableStreamDefaultControllerGetDesiredSize$](|stream|.[=ReadableStream/[[controller]]=])
-returns a positive number.
+<div algorithm>
+ To <dfn export for="ReadableStream">close</dfn> a {{ReadableStream}} |stream|:
+
+ 1. If |stream|.[=ReadableStream/[[controller]]=] [=implements=] {{ReadableByteStreamController}},
+ then perform !
+ [$ReadableByteStreamControllerClose$](|stream|.[=ReadableStream/[[controller]]=]).
+ 1. Perform ! [$ReadableStreamDefaultControllerClose$](|stream|.[=ReadableStream/[[controller]]=]).
```suggestion
1. Otherwise, perform ! [$ReadableStreamDefaultControllerClose$](|stream|.[=ReadableStream/[[controller]]=]).
```
> + To <dfn export for="ReadableStream">close</dfn> a {{ReadableStream}} |stream|:
+
+ 1. If |stream|.[=ReadableStream/[[controller]]=] [=implements=] {{ReadableByteStreamController}},
+ then perform !
+ [$ReadableByteStreamControllerClose$](|stream|.[=ReadableStream/[[controller]]=]).
+ 1. Perform ! [$ReadableStreamDefaultControllerClose$](|stream|.[=ReadableStream/[[controller]]=]).
+</div>
+
+<div algorithm>
+ To <dfn export for="ReadableStream">error</dfn> a {{ReadableStream}} |stream| given a JavaScript
+ value |e|:
+
+ 1. If |stream|.[=ReadableStream/[[controller]]=] [=implements=] {{ReadableByteStreamController}},
+ then perform ! [$ReadableByteStreamControllerError$](|stream|.[=ReadableStream/[[controller]]=],
+ |e|).
+ 1. Perform ! [$ReadableStreamDefaultControllerError$](|stream|.[=ReadableStream/[[controller]]=],
```suggestion
1. Otherwise, perform ! [$ReadableStreamDefaultControllerError$](|stream|.[=ReadableStream/[[controller]]=],
```
> +BYOB request view=] when it is non-null, and then call [=enqueue bytes=] with that view. They should
+only [=ArrayBufferView/create=] a new {{ArrayBufferView}} to pass to [=enqueue bytes=] when the
```suggestion
BYOB request view=] when it is non-null, and then call [=enqueue a view=] with that view. They should
only [=ArrayBufferView/create=] a new {{ArrayBufferView}} to pass to [=enqueue a view=] when the
```
> <p algorithm>To <dfn export for="ReadableStream">enqueue</dfn> the JavaScript value |chunk| into a
{{ReadableStream}} |stream|, perform !
[$ReadableStreamDefaultControllerEnqueue$](|stream|.[=ReadableStream/[[controller]]=], |chunk|).
For consistency (and our own sanity), we should make sure we're dealing with a non-byte stream:
```
1. Assert: |stream|.[=ReadableStream/[[controller]]=] [=implements=]
{{ReadableStreamDefaultController}}.
```
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1130#pullrequestreview-704489893
Received on Monday, 12 July 2021 20:23:38 UTC