On Tue, Jun 11, 2013 at 12:53 PM, Allen Wirfs-Brock
<[email protected]>wrote:
> But, really, for-of (and Arrray.from and friends) should just accept
> either an Iterable or an Iterator with priority given to Iterable
>
> Then the above an most conveniently be coded as:
>
> function giveMeAEmptyIterator( ) {
> return {
> next() {return {done: true}},
> }
> }
>
More convenient still:
function *giveMeAEmptyIterator() {}
This will work fine even if for-of remains as currently specified
(unconditionally calling the @@iterator method, as I think it should).
-j
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss