Why does Array.from accept non-iterable arraylikes?

Dean Landolt dean at deanlandolt.com
Wed Jun 26 10:50:49 PDT 2013

On Wed, Jun 26, 2013 at 1:31 PM, Brendan Eich <brendan at mozilla.com> wrote:

> Dean Landolt wrote:
>> sometimes it can fail in a way where you may want to proceed up the
>> prototype chain (or do something else). This is where I believe there are
>> interop landmines buried.
> How is this different from toString?

High-integrity generic code sidestes this problem by deferring to
Object.prototype.toString.call, the consequence being that you can never
really *rely* on a toString override. We make do, sure, but it sucks.
There's no good reason we should have to pay this price for iterable --
especially when the language is finally delivering *exactly* what's needed
(unique symbols) to avoid this issue going forward.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130626/24af106e/attachment.html>

More information about the es-discuss mailing list