Re: [whatwg/fetch] Set body with byte reading support (PR #1593)

@domenic commented on this pull request.



> +   <li>If |stream|'s [=ReadableStream/current BYOB request view=] is non-null, then set
+   |desiredSize| to |stream|'s [=ReadableStream/current BYOB request view=]'s [=BufferSource/byte
+   length=].
+
+   <li>Let |extractSize| be the smaller value of |available| and |desiredSize|.
+
+   <li>Let <var>bytes</var> be the result of extracting |extractSize| of bytes from
+   <var>buffer</var>.
+
+   <li>If |stream|s [=ReadableStream/current BYOB request view=] is non-null, then
+   [=ArrayBufferView/write=] |bytes| into |stream|'s [=ReadableStream/current BYOB request view=],
+   and set |view| to |stream|'s [=ReadableStream/current BYOB request view=]. <li>Otherwise, set
+   |view| to the result of [=ArrayBufferView/create|creating=] a {{Uint8Array}} from |bytes| in
+   |stream|'s [=relevant Realm=].
+
+   <li>[=ReadableStream/Enqueue=] |view| into |stream|.

You're right, I totally forgot that we wrapped up the JS `enqueue()` + `respond()` into a single spec-level call. Sorry!

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

Message ID: <whatwg/fetch/pull/1593/review/1265154377@github.com>

Received on Monday, 23 January 2023 08:26:09 UTC