Skip to content

Commit a3e0245

Browse files
committed
Call CreateReadableStream instead of the ReadableStream() constructor.
1 parent c7893b6 commit a3e0245

File tree

1 file changed

+35
-8
lines changed

1 file changed

+35
-8
lines changed

fetch.bs

+35-8
Original file line numberDiff line numberDiff line change
@@ -1876,18 +1876,45 @@ with given <var>strategy</var>, <var>pull</var> action and <var>cancel</var> act
18761876
are optional, run these steps:
18771877

18781878
<ol>
1879-
<li><p>Let <var>init</var> be a new object.
1879+
<li><p>Let <var>startAlg</var> be an algorithm that returns <code>undefined</code>.
18801880

1881-
<li><p>If <var>pull</var> is given, set <var>init</var>["pull"] to a function that returns
1882-
<var>pull</var>().
1881+
<li><p>Let <var>pullAlg</var> be an algorithm that returns:
18831882

1884-
<li><p>If <var>cancel</var> is given, set <var>init</var>["cancel"] to a function taking a
1885-
<var>reason</var> that returns <var>cancel</var>(<var>reason</var>).
1883+
<dl class=switch>
1884+
<dt>If <var>pull</var> is given
1885+
<dd>the result of [=promise-calling=] <var>pull</var>().
1886+
<dt>Otherwise
1887+
<dd>[=a promise resolved with=] <code>undefined</code>.
1888+
</dl>
1889+
1890+
<li><p>Let <var>cancelAlg</var> be an algorithm that takes a <var>reason</var> and returns:
1891+
<dl class=switch>
1892+
<dt>If <var>cancel</var> is given
1893+
<dd>the result of [=promise-calling=] <var>cancel</var>(<var>reason</var>).
1894+
<dt>Otherwise
1895+
<dd>[=a promise resolved with=] <code>undefined</code>.
1896+
</dl>
18861897

1887-
<li><p>Let <var>stream</var> be the result of calling the initial value of {{ReadableStream}} as
1888-
constructor with <var>init</var> and <var>strategy</var> if given.
1898+
<li><p>Let <var>highWaterMark</var> be:
1899+
<dl class=switch>
1900+
<dt>If <var>strategy</var> is given and <var>strategy</var>.<a spec=streams for="queuing
1901+
strategy">highWaterMark</a> exists
1902+
<dd><var>strategy</var>.<a spec=streams for="queuing strategy">highWaterMark</a>.
1903+
<dt>Otherwise
1904+
<dd><code>1</code>.
1905+
</dl>
1906+
1907+
<li><p>Let <var>sizeAlg</var> be:
1908+
<dl class=switch>
1909+
<dt>If <var>strategy</var> is given and <var>strategy</var>.<a idl spec=streams for="queuing
1910+
strategy" lt="size()">size</a> exists
1911+
<dd><var>strategy</var>.size.
1912+
<dt>Otherwise
1913+
<dd>an algorithm that returns <code>1</code>.
1914+
</dl>
18891915

1890-
<li><p>Return <var>stream</var>.
1916+
<li><p>Return [$CreateReadableStream$](<var>startAlg</var>, <var>pullAlg</var>,
1917+
<var>cancelAlg</var>, <var>highWaterMark</var>, <var>sizeAlg</var>).
18911918
</ol>
18921919

18931920
<p>To

0 commit comments

Comments
 (0)