- From: Mattias Buelens <notifications@github.com>
- Date: Thu, 07 Oct 2021 16:12:51 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/pull/1171/review/774472718@github.com>
@MattiasBuelens commented on this pull request. > @@ -3136,6 +3136,13 @@ The following abstract operations support the implementation of the [$TransferArrayBuffer$](|firstPendingPullInto|'s [=pull-into descriptor/buffer=]). 1. Perform ! [$ReadableByteStreamControllerInvalidateBYOBRequest$](|controller|). 1. If ! [$ReadableStreamHasDefaultReader$](|stream|) is true + 1. If |controller|.[=ReadableByteStreamController/[[pendingPullIntos]]=] is not + [=list/is empty|empty=], + 1. Assert: |controller|.[=ReadableByteStreamController/[[pendingPullIntos]]=]'s [=list/size=] Hang on... this is wrong. *Every call* to `ReadableStreamDefaultReader.read()` creates a new pull-into descriptor, regardless of whether we can `pull()` again. For example, this creates two such descriptors: ```javascript let controller; const stream = new ReadableStream({ start(c) { controller = c; }, type: 'bytes', autoAllocateChunkSize: 16 }, { highWaterMark: 0 }); const reader = stream.getReader(); const read1 = reader.read(); const read2 = reader.read(); ``` What *is* true is that, if `autoAllocateChunkSize` is not undefined, then the length of `[[pendingPullIntos]]` matches that of `[[readRequests]]`. So we need to remove *only* the first descriptor on `enqueue()`. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/pull/1171#discussion_r724595068
Received on Thursday, 7 October 2021 23:13:04 UTC