Re: [whatwg/streams] Create a dedicated section for interfacing with other specs (#1073)

@domenic commented on this pull request.



> + 1. Let |promise| be [=a new promise=].
+ 1. Let |bytes| be an empty [=byte sequence=].
+ 1. [=Read-loop=] given |reader|, |bytes|, and |promise|.
+ 1. Return |promise|.
+
+ <div algorithm="read-loop">
+  For the purposes of the above algorithm, to <dfn>read-loop</dfn> given |reader|, |bytes|, and
+  |promise|:
+
+  1. Let |readRequest| be a new [=read request=] with the following [=struct/items=]:
+   : [=read request/chunk steps=], given |chunk|
+   ::
+    1. If |chunk| is not a {{Uint8Array}} object, [=reject=] |promise| with a {{TypeError}} and
+       abort these steps.
+    1. Append the bytes represented by |chunk| to |bytes|.
+    1. [=Read-loop=] given |reader|, |bytes|, and |promise|.

Well, I guess such a requirement wouldn't be observable either, so scratch that part of my comment. But still.

-- 
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/1073#discussion_r488169991

Received on Monday, 14 September 2020 19:29:08 UTC