@@ -1876,18 +1876,45 @@ with given <var>strategy</var>, <var>pull</var> action and <var>cancel</var> act
1876
1876
are optional, run these steps:
1877
1877
1878
1878
<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> .
1880
1880
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:
1883
1882
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>
1886
1897
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>
1889
1915
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> ).
1891
1918
</ol>
1892
1919
1893
1920
<p> To
0 commit comments