W3C home > Mailing lists > Public > public-script-coord@w3.org > January to March 2015

RE: Idiomatic representation of { buffer, bytesRead }

From: Domenic Denicola <d@domenic.me>
Date: Wed, 4 Mar 2015 21:06:57 +0000
To: Jason Orendorff <jason.orendorff@gmail.com>
CC: "es-discuss@mozilla.org" <es-discuss@mozilla.org>, "public-script-coord@w3.org" <public-script-coord@w3.org>
Message-ID: <CY1PR0501MB1369824C52522671F19A5E5BDF1E0@CY1PR0501MB1369.namprd05.prod.outlook.com>
Thanks very much for the feedback Jason!


> But you can support both, like this:
> 
>     pull(DataView) -> Promise<DataView>
>     pull(TypedArrayView) -> Promise<TypedArrayView of the same type>
> 
> A view argument conveniently provides just the three pieces of information
> you need, plus a type.

I thought of that. However, I found it a bit strange that passing this function a view onto bytes [256, 512] of a 1024-byte buffer would detach the entire 1024-byte buffer. What do you think?

Received on Wednesday, 4 March 2015 21:07:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 4 March 2015 21:07:27 UTC