diff options
author | Benjamin Gruenbaum <benjamingr@gmail.com> | 2022-02-05 19:39:00 +0300 |
---|---|---|
committer | Benjamin Gruenbaum <benjamingr@gmail.com> | 2022-02-08 19:32:28 +0300 |
commit | 5942c90296a1b9782452da053f89aaafdd68e33c (patch) | |
tree | b6f4c65a8a4917f076e241b68b744ad7de8bbac6 /doc/api/webstreams.md | |
parent | d1a9c439ff61e476e11eab98919390b1031c675c (diff) |
doc: fix webstream close reject state state doc
The `closed` promise may reject. Document the states where it rejects
based on the spec.
Fixes: https://github.com/nodejs/node/issues/41858
PR-URL: https://github.com/nodejs/node/pull/41860
Co-Authored-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/webstreams.md')
-rw-r--r-- | doc/api/webstreams.md | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md index 99514a58e91..03fca145453 100644 --- a/doc/api/webstreams.md +++ b/doc/api/webstreams.md @@ -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()` @@ -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)` @@ -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` |