Extensible typed arrays use case in the wild
# Till Schneidereit (11 years ago)
thanks for bringing this up. IIUC, extensible typed arrays have been decided on, so we will implement them. CCing Niko, who is working on typed arrays and typed objects.
thanks for bringing this up. IIUC, extensible typed arrays have been decided on, so we will implement them. CCing Niko, who is working on typed arrays and typed objects.
Hey Domenic, thanks for bringing this up. IIUC, extensible typed arrays have been decided on, so we will implement them. CCing Niko, who is working on typed arrays and typed objects. On Wed, Nov 27, 2013 at 2:56 PM, Domenic Denicola < domenic at domenicdenicola.com> wrote: > I found this relevant to some previous discussions: > > > https://github.com/feross/native-buffer-browserify/commit/18c6784277e25db01ee145e5dfaaf23bb5b311fc > > The "native-buffer-browserify" is an attempt to provide a typed > array-based version of Node.js's Buffer interface [1]. (Buffer is something > that was created before TypedArrays existed.) In Firefox, which has > non-extensible typed arrays, this cannot be done, and so the author had to > resort to using a proxy that forwards to the underlying typed array. In > other engines, it worked straightforwardly. > > I believe this use case could also be solved by ES6-style subclassing > support on TypedArrays, but that doesn't appear to work in Firefox either, > from my tests. > > [1]: http://nodejs.org/docs/latest/api/buffer.html > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131127/440774d7/attachment.html>
I found this relevant to some previous discussions:
feross/native-buffer-browserify/commit/18c6784277e25db01ee145e5dfaaf23bb5b311fc
The "native-buffer-browserify" is an attempt to provide a typed array-based version of Node.js's Buffer interface 1. (Buffer is something that was created before TypedArrays existed.) In Firefox, which has non-extensible typed arrays, this cannot be done, and so the author had to resort to using a proxy that forwards to the underlying typed array. In other engines, it worked straightforwardly.
I believe this use case could also be solved by ES6-style subclassing support on TypedArrays, but that doesn't appear to work in Firefox either, from my tests.