Skip to content

Commit

Permalink
doc: fix webstream close reject state state doc
Browse files Browse the repository at this point in the history
The `closed` promise may reject. Document the states where it rejects
based on the spec.

Fixes: nodejs#41858

PR-URL: nodejs#41860
Co-Authored-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
2 people authored and bengl committed Feb 21, 2022
1 parent f0a71b5 commit d47d335
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/api/webstreams.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ added: v16.5.0
-->

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

#### `readableStreamDefaultReader.read()`

Expand Down Expand Up @@ -552,7 +553,8 @@ added: v16.5.0
-->
* Type: {Promise} Fulfilled with `undefined` when the associated
{ReadableStream} is closed or this reader's lock is released.
{ReadableStream} is closed or rejected if the stream errors or the reader's
lock is released before the stream finishes closing.
#### `readableStreamBYOBReader.read(view)`
Expand Down Expand Up @@ -902,9 +904,9 @@ Closes the `WritableStream` when no additional writes are expected.
added: v16.5.0
-->
* Type: A promise that is fulfilled with `undefined` when the
associated {WritableStream} is closed or this writer's lock is
released.
* Type: {Promise} Fulfilled with `undefined` when the associated
{WritableStream} is closed or rejected if the stream errors or the writer's
lock is released before the stream finishes closing.
#### `writableStreamDefaultWriter.desiredSize`
Expand Down

0 comments on commit d47d335

Please sign in to comment.