On Tue, Oct 7, 2014 at 2:35 PM, Tab Atkins Jr. <jackalm...@gmail.com> wrote:

> On Tue, Oct 7, 2014 at 2:26 PM, Dmitry Soshnikov
> <dmitry.soshni...@gmail.com> wrote:
> > I see. Actually it doesn't work, your're correct, since
> > `Array.prototype.map` does preserve the kind (at least in the latest
> draft).
>
> Hmm, per Rick's earlier email and
> <
> https://github.com/rwaldron/tc39-notes/blob/c61f48cea5f2339a1ec65ca89827c8cff170779b/es6/2013-01/jan-30.md#revising-the-array-subclassing-kind-issue
> >,
> Array#map (used by a subclass) doesn't preserve the subclass's type;
> it always returns an Array.
>
> > And the `UInt32Array.from(...)` would be consuming a nodeList, not an
> array.
> > Will the `nodeList.map(node => parseInt(node.value, 10));` by itself
> > actually work then?
>
> If .map() is inherited from Array, and thus not type-preserving, yes,
> it'll work.
>
>
Yes, it is preserving (probably was changed since that previous
discussion), see (9) in
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.map.
Will a simple map to `node.value` on a `NodeList` work with the preserving
`Array#map`?

Dmitry
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to