Why does Array.from accept non-iterable arraylikes?

Sam Tobin-Hochstadt samth at ccs.neu.edu
Tue Jun 25 09:01:07 PDT 2013


On Tue, Jun 25, 2013 at 11:58 AM, Jason Orendorff
<jason.orendorff at gmail.com> wrote:
> On Tue, Jun 25, 2013 at 10:42 AM, Sam Tobin-Hochstadt <samth at ccs.neu.edu> wrote:
>>> I think TC39 made @@iterator a symbol on the theory that users would
>>> want to build iterable Proxy-based string-key maps that would support
>>> property-access syntax.
>>
>> My recollection is that we chose to make `iterator` a symbol because
>> we worried about taking the name "iterator" on lots of existing
>> objects.
>
> What kind of existing code would be a problem?
>
> Firefox added Array.prototype.iterator a year ago. It has shipped in
> the release browser, and it's been fine.

I think that's strong evidence against the worry, but I believe the
worry was something like what we've seen with `values` recently.

Sam


More information about the es-discuss mailing list