From 97d341a970050754440a19ea6753abc86fcc7293 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 Co-Authored-By: Mattias Buelens --- doc/api/webstreams.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/api/webstreams.md b/doc/api/webstreams.md index 99514a58e91288..7c6ce5b49c977c 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)`