[Bug 17263] Keep on having send(ArrayBuffer data) interface in addition to send(ArrayBufferView data)

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17263

--- Comment #13 from Glenn Maynard <glenn@zewt.org> 2012-07-17 22:23:07 UTC ---
The ideal solution would be for ArrayBuffer and ArrayBufferView to share a base
class, so there'd be no distinction for functions like this, and people
wouldn't need to create a view over the whole buffer for functions that don't
care about data types.  (Ideally, ArrayBuffer would simply implement
Uint8Array.)

Unfortunately, the TypedArray Constructor(TypedArray array) and
Constructor(ArrayBuffer buffer, ...) constructors get in the way of this, since
unfortunately those functions do subtly but significantly different things (the
former allocates new storage, the latter creates a view).  It's hard to fix
this now without breakage: the TypedArray ctors should never allocate, and a
deep copy should require a separate function call.

I mention this only in case somebody has any ideas for correcting this that I
haven't thought of.  Maybe I'm overestimating the impact of changing
TypedArray(TypedArray) to creating a shallow view (maybe this is rare in
practice?), but I suspect not.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 17 July 2012 22:23:09 UTC