Skip to content

Commit 291fe63

Browse files
benjamingrMattiasBuelens
authored andcommitted
doc: fix webstream close reject state state doc
The `closed` promise may reject. Document the states where it rejects based on the spec. Fixes: #41858 PR-URL: #41860 Co-Authored-By: Mattias Buelens <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 2b1dabf commit 291fe63

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/api/webstreams.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ added: v16.5.0
425425
-->
426426

427427
* Type: {Promise} Fulfilled with `undefined` when the associated
428-
{ReadableStream} is closed or this reader's lock is released.
428+
{ReadableStream} is closed or rejected if the stream errors or the reader's
429+
lock is released before the stream finishes closing.
429430

430431
#### `readableStreamDefaultReader.read()`
431432

@@ -552,7 +553,8 @@ added: v16.5.0
552553
-->
553554
554555
* Type: {Promise} Fulfilled with `undefined` when the associated
555-
{ReadableStream} is closed or this reader's lock is released.
556+
{ReadableStream} is closed or rejected if the stream errors or the reader's
557+
lock is released before the stream finishes closing.
556558
557559
#### `readableStreamBYOBReader.read(view)`
558560
@@ -902,9 +904,9 @@ Closes the `WritableStream` when no additional writes are expected.
902904
added: v16.5.0
903905
-->
904906
905-
* Type: A promise that is fulfilled with `undefined` when the
906-
associated {WritableStream} is closed or this writer's lock is
907-
released.
907+
* Type: {Promise} Fulfilled with `undefined` when the associated
908+
{WritableStream} is closed or rejected if the stream errors or the writer's
909+
lock is released before the stream finishes closing.
908910
909911
#### `writableStreamDefaultWriter.desiredSize`
910912

0 commit comments

Comments
 (0)