Why does Array.from accept non-iterable arraylikes?
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...
More information about the es-discuss