Skip to content

Commit

Permalink
fixup - missin ? and undefined lengths
Browse files Browse the repository at this point in the history
  • Loading branch information
leobalter committed Mar 21, 2016
1 parent dd13557 commit cdfd3f6
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -31596,11 +31596,13 @@ <h1>_TypedArray_ ( _length_ )</h1>
<emu-alg>
1. Assert: Type(_length_) is not Object.
1. If NewTarget is *undefined*, throw a *TypeError* exception.
1. If _length_ is *undefined*, throw a *TypeError* exception.
1. Let _numberLength_ be ToNumber(_length_).
1. If _numberLength_ &lt; 0, throw a *RangeError* exception.
1. Let _elementLength_ be ? ToLength(_numberLength_).
1. If SameValueZero(_numberLength_, _elementLength_) is *false*, throw a *RangeError* exception.
1. If _length_ is either not present or *undefined*, then
1. Let _elementLength_ be *0*.
1. Else,
1. Let _numberLength_ be ToNumber(_length_).
1. If _numberLength_ &lt; 0, throw a *RangeError* exception.
1. Let _elementLength_ be ? ToLength(_numberLength_).
1. If SameValueZero(_numberLength_, _elementLength_) is *false*, throw a *RangeError* exception.
1. Let _constructorName_ be the String value of the Constructor Name value specified in <emu-xref href="#table-49"></emu-xref> for this <var>TypedArray</var> constructor.
1. Return ? AllocateTypedArray(_constructorName_, NewTarget, <code>"%<var>TypedArray</var>Prototype%"</code>, _elementLength_).
</emu-alg>
Expand Down Expand Up @@ -32993,10 +32995,13 @@ <h1>ArrayBuffer ( [ _length_ ] )</h1>
<p>When the `ArrayBuffer` function is called with optional argument _length_, the following steps are taken:</p>
<emu-alg>
1. If NewTarget is *undefined*, throw a *TypeError* exception.
1. Let _numberLength_ be ToNumber(_length_).
1. If _numberLength_ &lt; 0, throw a *RangeError* exception.
1. Let _byteLength_ be ? ToLength(_numberLength_).
1. If SameValueZero(_numberLength_, _byteLength_) is *false*, throw a *RangeError* exception.
1. If _length_ is either not present or *undefined*, then
1. Let _byteLength_ be *0*.
1. Else,
1. Let _numberLength_ be ? ToNumber(_length_).
1. If _numberLength_ &lt; 0, throw a *RangeError* exception.
1. Let _byteLength_ be ? ToLength(_numberLength_).
1. If SameValueZero(_numberLength_, _byteLength_) is *false*, throw a *RangeError* exception.
1. Return ? AllocateArrayBuffer(NewTarget, _byteLength_).
</emu-alg>
</emu-clause>
Expand Down Expand Up @@ -33186,7 +33191,7 @@ <h1>DataView (_buffer_ [ , _byteOffset_, _byteLength_ ] )</h1>
1. If _byteLength_ is either not present or *undefined*, then
1. Let _viewByteLength_ be _bufferByteLength_ - _offset_.
1. Else,
1. Let _numberLength_ be ToNumber(_byteLength_).
1. Let _numberLength_ be ? ToNumber(_byteLength_).
1. If _numberLength_ &lt; 0, throw a *RangeError* exception.
1. Let _viewByteLength_ be ? ToLength(_numberLength_).
1. If SameValueZero(_numberLength_, _viewByteLength_) is *false*, throw a *RangeError* exception.
Expand Down

0 comments on commit cdfd3f6

Please sign in to comment.