From b950f5db8440bb0ea490a5dd5e377d7647282835 Mon Sep 17 00:00:00 2001 From: Benjamin Gruenbaum Date: Sat, 5 Feb 2022 18:39:00 +0200 Subject: [PATCH] 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 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- doc/api/webstreams.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md index 14909704f384f1..cc5aae34a56922 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`