On Tue, Oct 7, 2014 at 2:26 PM, Dmitry Soshnikov
<[email protected]> 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.

~TJ
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to