W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2013

Re: How to correctly spec sequences requiring an iterable

From: Rick Waldron <waldron.rick@gmail.com>
Date: Fri, 15 Nov 2013 11:29:17 -0500
Message-ID: <CAHfnhfp=8ff6P_Ohj6X6hfsS++QVyzNRkyPieQEx=-Egi_+PrQ@mail.gmail.com>
To: Jason Orendorff <jason.orendorff@gmail.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
On Fri, Nov 15, 2013 at 11:24 AM, Jason Orendorff <jason.orendorff@gmail.com
> wrote:

> 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.
>

I was mid-typing when came through... HasProperty(obj, @@iterator) should
be sufficient since the well known @@iterator symbol can only be that
symbol.

Rick
Received on Friday, 15 November 2013 16:30:03 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:19 UTC