W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

Re: Should send() be able to take an ArrayBufferView?

From: Charles Pritchard <chuck@jumis.com>
Date: Wed, 11 Apr 2012 13:40:55 -0700
Message-ID: <4F85EC57.1090901@jumis.com>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: Glenn Maynard <glenn@zewt.org>, public-webapps <public-webapps@w3.org>
On 4/11/2012 1:16 PM, Boris Zbarsky wrote:
> On 4/11/12 4:06 PM, Glenn Maynard wrote:
>> It's a bit worse than that, actually: if you want to send only part of a
>> buffer, you have to create a whole new ArrayBuffer and copy the data
>> over.  If you just pass "view.buffer", you'll send the *whole*
>> underlying buffer, not just the slice represented by the view.
> Oh, that's just broken.
> That argues for the removal of the ArrayBuffer overload, indeed, and 
> just leaving the ArrayBufferView version.

I've got no idea where TC39 is taking things. I think that's the bigger 
issue here.
Yes, I've been bitten by trying to use .subarray  instead of .slice (as 
Glenn points out).

If ArrayBufferView becomes a JS semantic, some of this is moot; and 
ArrayBuffer is still very necessary for compatibility.

All of the postMessage semantics use ArrayBuffer AFAIK.

I know you've been circling this issue for awhile, so I'll put it out 
there again: yes, using typed arrays is difficult.

Received on Wednesday, 11 April 2012 20:41:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:33 UTC