Re: How to correctly spec sequences requiring an iterable

On Fri, Nov 15, 2013 at 10:08 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
> An obvious question that arises is what the definition of iterable is.
>
> Is it something for which HasProperty(obj, @@iterator) returns true?
>
> Is it something for which GetProperty(obj, @@iterator) returns something
> other than undefined?
>
> Is it something for which GetProperty(obj, @@iterator) returns a callable
> object?

Array.from[1] has to make this determination, such that it can't "just
iterate and see". At the moment it is spec'd to use HasProperty(obj,
@@iterator). But that is inconsistent; other places where we check for
a method always use the third criterion. I hope Allen can weigh in.

-j

[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from

Received on Friday, 15 November 2013 16:24:48 UTC