Skip to content

Commit a71caad

Browse files
jyasskinjungkees
authored andcommitted
Update the strategy argument to 'construct a ReadableStream'. (#1338)
Update the strategy argument to 'construct a ReadableStream' according to whatwg/fetch#781.
1 parent 73f5551 commit a71caad

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

docs/index.bs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1437,14 +1437,15 @@ spec: webappsec-referrer-policy; urlPrefix: https://w3c.github.io/webappsec-refe
14371437
1. Let |potentialResponse| be a copy of |response|'s associated [=Response/response=], except for its [=response/body=].
14381438
1. If |response|'s [=response/body=] is non-null, run these substeps:
14391439
1. Let |reader| be the result of <a lt="get a reader">getting a reader</a> from |response|'s [=response/body=]'s <a>stream</a>.
1440-
1. Let |strategy| be an object created in |targetRealm|. The user agent may choose any object.
1440+
1. Let |highWaterMark| be a non-negative, non-NaN number, chosen by the user agent.
1441+
1. Let |sizeAlgorithm| be an algorithm that accepts a [=chunk=] object and returns a non-negative, non-NaN, non-infinite number, chosen by the user agent.
14411442
1. Let |pull| be an action that runs these subsubsteps:
14421443
1. Let |promise| be the result of <a lt="read a chunk">reading a chunk</a> from |response|'s [=response/body=]'s <a>stream</a> with |reader|.
14431444
1. When |promise| is fulfilled with an object whose <code>done</code> property is false and whose <code>value</code> property is a <code>Uint8Array</code> object, append the bytes represented by the <code>value</code> property to |bytes| and perform ! <a>DetachArrayBuffer</a> with the <code>ArrayBuffer</code> object wrapped by the <code>value</code> property.
14441445
1. When |promise| is fulfilled with an object whose <code>done</code> property is true, set |end-of-body| to true.
14451446
1. When |promise| is fulfilled with a value that matches with neither of the above patterns, or |promise| is rejected, [=ReadableStream/error=] |newStream| with a <code>TypeError</code>.
14461447
1. Let |cancel| be an action that [=ReadableStream/cancels=] |response|'s [=response/body=]'s <a>stream</a> with |reader|.
1447-
1. Let |newStream| be the result of [=ReadableStream/construct a ReadableStream object=] with |strategy|, |pull| and |cancel| in |targetRealm|.
1448+
1. Let |newStream| be the result of [=ReadableStream/construct a ReadableStream object=] with |highWaterMark|, |sizeAlgorithm|, |pull|, and |cancel| in |targetRealm|.
14481449
1. Set |potentialResponse|'s [=response/body=] to a new [=/body=] whose <a>stream</a> is |newStream|.
14491450
1. Run these subsubsteps repeatedly <a>in parallel</a> while |done| is false:
14501451
1. If |newStream| is <a>errored</a>, then set |done| to true.

0 commit comments

Comments
 (0)