Re: [whatwg/streams] Add ReadableStreamBYOBReader.read(view, { min }) (#1145)

@MattiasBuelens commented on this pull request.



> @@ -3151,7 +3197,8 @@ The following abstract operations support the implementation of the
  1. If |controller|.[=ReadableByteStreamController/[[pendingPullIntos]]=] is not empty,
   1. Let |firstPendingPullInto| be
      |controller|.[=ReadableByteStreamController/[[pendingPullIntos]]=][0].
-  1. If |firstPendingPullInto|'s [=pull-into descriptor/bytes filled=] > 0,
+  1. If |firstPendingPullInto|'s [=pull-into descriptor/bytes filled=]
+     mod |firstPendingPullInto|'s [=pull-into descriptor/element size=] is not 0,

In the non-min case, `minimum fill` is set to `element size`. As soon as the pull-into descriptor is filled with at least one complete element, that descriptor gets popped off the queue and its read-into request is fulfilled. So it will no longer be in the queue by the time we get to `ReadableByteStreamControllerClose()`.

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

Message ID: <whatwg/streams/pull/1145/review/1472431682@github.com>

Received on Friday, 9 June 2023 15:29:17 UTC