Re: [whatwg/streams] Reject pending reads when releasing reader (#1168)

@MattiasBuelens commented on this pull request.



> @@ -945,6 +965,16 @@ function ReadableStreamDefaultReaderRead(reader, readRequest) {
   }
 }
 
+function ReadableStreamDefaultReaderRelease(reader) {
+  const e = new TypeError('Reader was released');
+  const readRequests = reader._readRequests;
+  reader._readRequests = [];

Added `ReadableStreamDefaultReaderErrorReadRequests` and `ReadableStreamBYOBReaderErrorReadIntoRequests` helpers.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1168#discussion_r778899944
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/pull/1168/review/844718076@github.com>

Received on Wednesday, 5 January 2022 15:14:56 UTC