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

Re: How to correctly spec sequences requiring an iterable

From: Jason Orendorff <jason.orendorff@gmail.com>
Date: Fri, 15 Nov 2013 10:24:20 -0600
Message-ID: <CAPh8+Zpa8YiGqzP_TU921_h0YLGUzPDKvLKrx3wwOLLjPQgR9w@mail.gmail.com>
To: Boris Zbarsky <bzbarsky@mit.edu>
Cc: "public-script-coord@w3.org" <public-script-coord@w3.org>
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.


[1] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from
Received on Friday, 15 November 2013 16:24:48 UTC

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