diff --git a/spec.html b/spec.html index b644cd1..0044dd3 100644 --- a/spec.html +++ b/spec.html @@ -22,7 +22,6 @@

Uint8Array.prototype.toBase64 ( [ _options_ ] )

1. Let _opts_ be ? GetOptionsObject(_options_). 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. - 1. If _alphabet_ is not a String, throw a *TypeError* exception. 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. 1. Let _toEncode_ be ? GetUint8ArrayBytes(_O_). 1. If _alphabet_ is *"base64"*, then @@ -56,7 +55,6 @@

Uint8Array.fromBase64 ( _string_ [ , _options_ ] )

1. Let _opts_ be ? GetOptionsObject(_options_). 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. - 1. If _alphabet_ is not a String, throw a *TypeError* exception. 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. 1. Let _lastChunkHandling_ be ? Get(_opts_, *"lastChunkHandling"*). 1. If _lastChunkHandling_ is *undefined*, set _lastChunkHandling_ to *"loose"*. @@ -78,16 +76,14 @@

Uint8Array.prototype.setFromBase64 ( _string_ [ , _options_ ] )

1. Let _opts_ be ? GetOptionsObject(_options_). 1. Let _alphabet_ be ? Get(_opts_, *"alphabet"*). 1. If _alphabet_ is *undefined*, set _alphabet_ to *"base64"*. - 1. If _alphabet_ is not a String, throw a *TypeError* exception. 1. If _alphabet_ is neither *"base64"* nor *"base64url"*, throw a *TypeError* exception. 1. Let _lastChunkHandling_ be ? Get(_opts_, *"lastChunkHandling"*). 1. If _lastChunkHandling_ is *undefined*, set _lastChunkHandling_ to *"loose"*. 1. If _lastChunkHandling_ is not one of *"loose"*, *"strict"*, or *"stop-before-partial"*, throw a *TypeError* exception. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_into_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Let _byteLength_ be TypedArrayByteLength(_taRecord_). - 1. Let _maxLength_ be _byteLength_. - 1. Let _result_ be ? FromBase64(_string_, _alphabet_, _lastChunkHandling_, _maxLength_). + 1. Let _byteLength_ be TypedArrayLength(_taRecord_). + 1. Let _result_ be ? FromBase64(_string_, _alphabet_, _lastChunkHandling_, _byteLength_). 1. Let _bytes_ be _result_.[[Bytes]]. 1. Let _written_ be the length of _bytes_. 1. NOTE: FromBase64 does not invoke any user code, so the ArrayBuffer backing _into_ cannot have been detached or shrunk. @@ -120,9 +116,8 @@

Uint8Array.prototype.setFromHex ( _string_ )

1. If _string_ is not a String, throw a *TypeError* exception. 1. Let _taRecord_ be MakeTypedArrayWithBufferWitnessRecord(_into_, ~seq-cst~). 1. If IsTypedArrayOutOfBounds(_taRecord_) is *true*, throw a *TypeError* exception. - 1. Let _byteLength_ be TypedArrayByteLength(_taRecord_). - 1. Let _maxLength_ be _byteLength_. - 1. Let _result_ be ? FromHex(_string_, _maxLength_). + 1. Let _byteLength_ be TypedArrayLength(_taRecord_). + 1. Let _result_ be ? FromHex(_string_, _byteLength_). 1. Let _bytes_ be _result_.[[Bytes]]. 1. Let _written_ be the length of _bytes_. 1. NOTE: FromHex does not invoke any user code, so the ArrayBuffer backing _into_ cannot have been detached or shrunk. @@ -225,7 +220,7 @@

-

The standard base64 alphabet is a List whose elements are the code points corresponding to every letter and number in the Unicode Basic Latin block along with *"+"* and *"/"*; that is, it is StringToCodePoints(*"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"*).

+

The standard base64 alphabet is the String whose elements are the code units corresponding to every letter and number in the Unicode Basic Latin block along with *"+"* and *"/"*; that is, it is *"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"*.

1. Let _chunkLength_ be the length of _chunk_. 1. If _chunkLength_ is 2, then @@ -313,7 +308,7 @@

1. If _char_ is either *"+"* or *"/"*, throw a *SyntaxError* exception. 1. Else if _char_ is *"-"*, set _char_ to *"+"*. 1. Else if _char_ is *"_"*, set _char_ to *"/"*. - 1. If _char_ is not an element of the standard base64 alphabet, throw a *SyntaxError* exception. + 1. If the sole code unit of _char_ is not an element of the standard base64 alphabet, throw a *SyntaxError* exception. 1. Let _remaining_ be _maxLength_ - the length of _bytes_. 1. If _remaining_ = 1 and _chunkLength_ = 2, or if _remaining_ = 2 and _chunkLength_ = 3, then 1. Return the Record { [[Read]]: _read_, [[Bytes]]: _bytes_ }.