Final iterator spec

Claude Pache claude.pache at
Mon Mar 3 03:49:53 PST 2014

Le 3 mars 2014 à 10:46, Andy Wingo <wingo at> a écrit :

> An iterable is simply an object with a callable @@iterator property.
> Calling @@iterator on an object and getting back a result is the
> sum-total of the iterator structural type -- so yes, this problem is
> solved.

What does exactly the spec think what an iterable is? As far as I can tell, only `Array.from` and `%TypedArray%.from` test for iterability, and until [bug 2486] is resolved, it is hard for us to guess, because there are really more than one possible answer, e.g.: `Symbol.iterator in obj` and `typeof obj[Symbol.iterator] === "function"`. 

Section The Iterable Interface [1] define something more restrictive than `typeof obj[Symbol.iterator] === "function"`` and less testable, given the requirements of the returned value of `obj[Symbol.iterator]()`.


[bug 2486]

More information about the es-discuss mailing list