diff --git a/encoding.bs b/encoding.bs index f34ab30..ffe45fe 100644 --- a/encoding.bs +++ b/encoding.bs @@ -234,8 +234,8 @@ items, in the given order, before the first item in the queue. byte sequence input into an I/O queue, run these steps:
Assert: if input is a list, then it does not contain - end-of-queue. +
Assert: input is not a list or it does not + contain end-of-queue.
Return an I/O queue containing the items in input, in order, followed by end-of-queue. @@ -259,6 +259,21 @@ algorithms, as detailed in [[#implementation-considerations]]. 0x10000 + ((leading − 0xD800) << 10) + (trailing − 0xDC00). +
To create a Uint8Array
object, given an I/O queue
+ioQueue and a realm realm:
+
+
Let bytes be the result of converting + ioQueue into a byte sequence. + +
Return the result of creating a {{Uint8Array}} object from + bytes in realm. +
Assert: if encoderDecoder is an encoder instance, mode is
- not "replacement
".
+
Assert: encoderDecoder is not an encoder instance or
+ mode is not "replacement
".
-
Assert: if encoderDecoder is a decoder instance, mode is
- not "html
".
+
Assert: encoderDecoder is not a decoder instance or
+ mode is not "html
".
-
Assert: if encoderDecoder is an encoder instance, item is - not a surrogate. +
Assert: encoderDecoder is not an encoder instance or + item is not a surrogate.
Let result be the result of running encoderDecoder's handler on
input and item.
@@ -358,8 +373,8 @@ given an item item, encoding's
Otherwise, if result is one or more items:
Assert: if encoderDecoder is a decoder instance, result
- does not contain any surrogates.
+ Assert: encoderDecoder is not a decoder instance or
+ result does not contain any surrogates.
Push result to output.
-
@@ -1216,7 +1231,7 @@ is safe as it never triggers errors. [[HTML]]
encoding encoding:
Assert: encoding is not replacement or UTF-16BE/LE. +
Assert: encoding is not replacement or UTF-16BE/LE.
Return an instance of encoding's encoder.
fatal
".
Assert: result is not an error. +
Assert: result is not an error.
The UTF-8 encoder cannot return error. -
If result is finished, then convert - output into a byte sequence and return a {{Uint8Array}} object wrapping an - {{ArrayBuffer}} containing output. - +
If result is finished, then return the result of
+ creating a Uint8Array
object given output and this's
+ relevant realm.
Let outputChunk be the result of running serialize I/O queue with decoder and output. -
If outputChunk is non-empty, then enqueue - outputChunk in decoder's transform. +
If outputChunk is not the empty string, then + enqueue outputChunk in decoder's + transform.
Return. @@ -1942,8 +1957,9 @@ steps:
Let outputChunk be the result of running serialize I/O queue with decoder and output. -
If outputChunk is non-empty, then enqueue - outputChunk in decoder's transform. +
If outputChunk is not the empty string, then + enqueue outputChunk in decoder's + transform.
Return. @@ -2067,11 +2083,11 @@ constructor steps are:
Convert output into a byte sequence.
If output is non-empty: +
If output is not empty:
Let chunk be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing - output. +
Let chunk be the result of creating a Uint8Array
object
+ given output and encoder's relevant realm.
Enqueue chunk into encoder's transform. @@ -2136,8 +2152,8 @@ that are split between strings. [[!INFRA]]
Let chunk be a {{Uint8Array}} object wrapping an {{ArrayBuffer}} containing - 0xEF 0xBF 0xBD. +
Let chunk be the result of creating a Uint8Array
object given
+ « 0xEF, 0xBF, 0xBD » and encoder's relevant realm.
This is U+FFFD (�) in UTF-8 bytes.