- From: Jonas Sicking <jonas@sicking.cc>
- Date: Thu, 13 May 2010 17:17:17 -0700
- To: Erik Arvidsson <erik.arvidsson@gmail.com>
- Cc: arun@mozilla.com, public-script-coord@w3.org, es-discuss@mozilla.org, Alex Russell <alex@dojotoolkit.org>
On Thu, May 13, 2010 at 4:57 PM, Erik Arvidsson <erik.arvidsson@gmail.com> wrote: > I'm surprised no one has said this yet but here goes: > > ArrayBuffer needs to extend Array. In other words instances of > ArrayBuffer needs to also be instances of Array > > var ab = new ArrayBuffer; > assert(ab instanceof ArrayBuffer); > assert(ab instanceof Array); > > You will also need to make sure that all the internal methods are > defined. See 8.12 Algorithms for Object Internal Methods of ES5. For > example what does it mean to do [[Delete]] on a byte array? My biggest beef with ArrayBuffer is that since it can be cast between Int8 and Int16, it exposes endianness of the CPU the code is running on. I.e. it will be very easy to write code that works on Intel CPUs, but not on Motorola 68K CPUs. I don't have much faith in that website developers will test the endiannness of the CPU they are running on and manually convert, rather than cast, if the endianness is "wrong". / Jonas
Received on Friday, 14 May 2010 00:18:12 UTC