typed arrays

C. Scott Ananian ecmascript at cscott.net
Tue Mar 4 08:17:50 PST 2014


While we're on the topic, let me bang the drum one last time for tweaking
some of the `Array` built-ins so that they can be applied to `TypedArray`s.
The fact that there are separate `Array.from` and `%TypedArray%.from`
methods in the spec (for example) makes me sad. IIRC all that is needed in
`Array.from` is to avoid writing the length field if the length of the
receiver is already correct. Similarly, if we defined a `GetLength` helper
that special-cased instances of `TypedArray`, the definitions of
`Array#forEach`, etc could simply say, "`%TypedArray%#forEach` is strictly
equal to `Array#forEach`".

Of course implementors will specialize on the receiver type, but this
detail shouldn't be exposed in the spec IMO.
  --scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140304/8ff021bd/attachment.html>


More information about the es-discuss mailing list