archives

« Bugzilla Issues Index

#1672 — 15.13.6.1: %TypedArray% constructors and constructor selection issues


The constructor "15.13.6.1.1 %TypedArray% (length)":
- change end of first sentence in preamble from "is not Number" to "is not Object".
- step 2 is empty


The constructor "15.13.6.1.2 %TypedArray% (typedArray)":
- add an additional step to throw a TypeError if srcArray's [[ViewedArrayBuffer]] is undefined
- srcArray's [[ByteOffset]] data property is not taken into account when the array buffer is cloned
- remove step 16-17, the data was already cloned in step 12, calling SetArrayBufferData() would erase the contents resp. create a new clear buffer


The constructor "15.13.6.1.3 %TypedArray% (array)":
- step 3, variable "srcArray" is unused
- step 12, change TypeError to RangeError
- step 17, change "status" to "data"
- step 19b, change "Get(O, Pk)" to "Get(array, Pk)"


The constructor "15.13.6.1.4 %TypedArray% (buffer, byteOffset=0, length=undefined)":
- missing step? If buffer's [[ArrayBufferData]] is undefined then throw TypeError. Or should it be possible to initialise a TypedArray object with an uninitialised ArrayBuffer object?
- add test after step 15b, if newByteLength < 0 then throw RangeError


"15.13.6.1.6 %TypedArray% (all other argument combinations)":
- Typo "that do match" -> "that do not match"


The constructor selection does not reflect the current browser situation, e.g. SpiderMonkey/V8/JSC accept `new Int8Array(16, 0)` and treat it as an equivalent call to `new Int8Array(16)` whereas the current selection algorithm requires this call to throw a TypeError.


fixed in rev17 editor's draft


fixed in rev17, August 23, 2013 draft