@@ -235,8 +235,8 @@ items, in the given order, before the first item in the queue.
235
235
<a>byte sequence</a> <var> input</var> into an <a for=/>I/O queue</a> , run these steps:
236
236
237
237
<ol>
238
- <li><p> Assert: if <var> input</var> is a <a for=/>list</a> , then it does not <a for=list>contain</a>
239
- <a>end-of-queue</a> .
238
+ <li><p> <a for=/> Assert</a> : <var> input</var> is not a <a for=/>list</a> or it does not
239
+ <a for=list>contain</a> <a >end-of-queue</a> .
240
240
241
241
<li><p> Return an <a for=/>I/O queue</a> containing the <a for=list>items</a> in <var> input</var> ,
242
242
in order, followed by <a>end-of-queue</a> .
@@ -260,6 +260,21 @@ algorithms, as detailed in [[#implementation-considerations]].
260
260
0x10000 + ((<var> leading</var> − 0xD800) << 10) + (<var> trailing</var> − 0xDC00).
261
261
</div>
262
262
263
+ <hr>
264
+
265
+ <div algorithm>
266
+ <p> To <dfn>create a <code>Uint8Array</code> object</dfn> , given an <a for=/>I/O queue</a>
267
+ <var> ioQueue</var> and a <a for=ECMAScript>realm</a> <var> realm</var> :
268
+
269
+ <ol>
270
+ <li><p> Let <var> bytes</var> be the result of <a for="from I/O queue">converting</a>
271
+ <var> ioQueue</var> into a byte sequence.
272
+
273
+ <li><p> Return the result of <a for=ArrayBufferView>creating</a> a {{Uint8Array}} object from
274
+ <var> bytes</var> in <var> realm</var> .
275
+ </ol>
276
+ </div>
277
+
263
278
264
279
265
280
<h2 id=encodings>Encodings</h2>
@@ -333,14 +348,14 @@ given an <a for=list>item</a> <var>item</var>, <a for=/>encoding</a>'s <a for=/>
333
348
<a for=/>I/O queue</a> <var> output</var> , and <a for=/>error mode</a> <var> mode</var> :
334
349
335
350
<ol>
336
- <li><p> Assert: if <var> encoderDecoder</var> is an <a for=/>encoder</a> instance, <var> mode </var> is
337
- not "<code> replacement</code> ".
351
+ <li><p> <a for=/> Assert</a> : <var> encoderDecoder</var> is not an <a for=/>encoder</a> instance or
352
+ <var> mode </var> is not "<code> replacement</code> ".
338
353
339
- <li><p> Assert: if <var> encoderDecoder</var> is a <a for=/>decoder</a> instance, <var> mode </var> is
340
- not "<code> html</code> ".
354
+ <li><p> <a for=/> Assert</a> : <var> encoderDecoder</var> is not a <a for=/>decoder</a> instance or
355
+ <var> mode </var> is not "<code> html</code> ".
341
356
342
- <li><p> Assert: if <var> encoderDecoder</var> is an <a for=/>encoder</a> instance, <var> item </var> is
343
- not a <a>surrogate</a> .
357
+ <li><p> <a for=/> Assert</a> : <var> encoderDecoder</var> is not an <a for=/>encoder</a> instance or
358
+ <var> item </var> is not a <a>surrogate</a> .
344
359
345
360
<li><p> Let <var> result</var> be the result of running <var> encoderDecoder</var> 's <a>handler</a> on
346
361
<var> input</var> and <var> item</var> .
@@ -359,8 +374,8 @@ given an <a for=list>item</a> <var>item</var>, <a for=/>encoding</a>'s <a for=/>
359
374
<p> Otherwise, if <var> result</var> is one or more <a for=list>items</a> :
360
375
361
376
<ol>
362
- <li><p> Assert: if <var> encoderDecoder</var> is a <a for=/>decoder</a> instance, <var> result </var>
363
- does not contain any <a>surrogates</a> .
377
+ <li><p> <a for=/> Assert</a> : <var> encoderDecoder</var> is not a <a for=/>decoder</a> instance or
378
+ <var> result </var> does not contain any <a>surrogates</a> .
364
379
365
380
<li><p> <a>Push</a> <var> result</var> to <var> output</var> .
366
381
</ol>
@@ -1216,7 +1231,7 @@ is safe as it never triggers <a>errors</a>. [[HTML]]
1216
1231
<a for=/>encoding</a> <var> encoding</var> :
1217
1232
1218
1233
<ol>
1219
- <li><p> Assert: <var> encoding</var> is not <a>replacement</a> or <a>UTF-16BE/LE</a> .
1234
+ <li><p> <a for=/> Assert</a> : <var> encoding</var> is not <a>replacement</a> or <a>UTF-16BE/LE</a> .
1220
1235
1221
1236
<li><p> Return an instance of <var> encoding</var> 's <a for=/>encoder</a> .
1222
1237
</ol>
@@ -1660,14 +1675,13 @@ constructor steps are to do nothing.
1660
1675
"<code> fatal</code> ".
1661
1676
1662
1677
<li>
1663
- <p> Assert: <var> result</var> is not an <a>error</a> .
1678
+ <p> <a for=/> Assert</a> : <var> result</var> is not an <a>error</a> .
1664
1679
1665
1680
<p class=note> The <a>UTF-8 encoder</a> cannot return <a>error</a> .
1666
1681
1667
- <li><p> If <var> result</var> is <a>finished</a> , then <a for="from I/O queue">convert</a>
1668
- <var> output</var> into a byte sequence and return a {{Uint8Array}} object wrapping an
1669
- {{ArrayBuffer}} containing <var> output</var> .
1670
- <!-- XXX https://www.w3.org/Bugs/Public/show_bug.cgi?id=26966 -->
1682
+ <li><p> If <var> result</var> is <a>finished</a> , then return the result of
1683
+ <a>creating a <code>Uint8Array</code> object</a> given <var> output</var> and <a>this</a> 's
1684
+ <a>relevant realm</a> .
1671
1685
</ol>
1672
1686
</ol>
1673
1687
</div>
@@ -1898,8 +1912,9 @@ constructor steps are:
1898
1912
<li><p> Let <var> outputChunk</var> be the result of running <a>serialize I/O queue</a> with
1899
1913
<var> decoder</var> and <var> output</var> .
1900
1914
1901
- <li><p> If <var> outputChunk</var> is non-empty, then <a for=TransformStream>enqueue</a>
1902
- <var> outputChunk</var> in <var> decoder</var> 's <a for=GenericTransformStream>transform</a> .
1915
+ <li><p> If <var> outputChunk</var> is not the empty string, then
1916
+ <a for=TransformStream>enqueue</a> <var> outputChunk</var> in <var> decoder</var> 's
1917
+ <a for=GenericTransformStream>transform</a> .
1903
1918
1904
1919
<li><p> Return.
1905
1920
</ol>
@@ -1942,8 +1957,9 @@ steps:
1942
1957
<li><p> Let <var> outputChunk</var> be the result of running <a>serialize I/O queue</a> with
1943
1958
<var> decoder</var> and <var> output</var> .
1944
1959
1945
- <li><p> If <var> outputChunk</var> is non-empty, then <a for=TransformStream>enqueue</a>
1946
- <var> outputChunk</var> in <var> decoder</var> 's <a for=GenericTransformStream>transform</a> .
1960
+ <li><p> If <var> outputChunk</var> is not the empty string, then
1961
+ <a for=TransformStream>enqueue</a> <var> outputChunk</var> in <var> decoder</var> 's
1962
+ <a for=GenericTransformStream>transform</a> .
1947
1963
1948
1964
<li><p> Return.
1949
1965
</ol>
@@ -2067,11 +2083,11 @@ constructor steps are:
2067
2083
<li><p> <a for="from I/O queue">Convert</a> <var> output</var> into a byte sequence.
2068
2084
2069
2085
<li>
2070
- <p> If <var> output</var> is non- empty:
2086
+ <p> If <var> output</var> <a for=list> is not empty</a> :
2071
2087
2072
2088
<ol>
2073
- <li><p> Let <var> chunk</var> be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing
2074
- <var> output</var> .
2089
+ <li><p> Let <var> chunk</var> be the result of <a>creating a <code>Uint8Array</code> object</a>
2090
+ given <var> output</var> and <var> encoder </var> 's <a>relevant realm</a > .
2075
2091
2076
2092
<li><p> <a for=TransformStream>Enqueue</a> <var> chunk</var> into <var> encoder</var> 's
2077
2093
<a for=GenericTransformStream>transform</a> .
@@ -2136,8 +2152,8 @@ that are split between strings. [[!INFRA]]
2136
2152
2137
2153
<ol>
2138
2154
<li>
2139
- <p> Let <var> chunk</var> be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing
2140
- 0xEF 0xBF 0xBD.
2155
+ <p> Let <var> chunk</var> be the result of <a>creating a <code>Uint8Array</code> object</a> given
2156
+ « 0xEF, 0xBF, 0xBD » and <var> encoder </var> 's <a>relevant realm</a> .
2141
2157
2142
2158
<p class=note> This is U+FFFD (�) in <a>UTF-8</a> bytes.
2143
2159
0 commit comments