generator function requirements

Rick Waldron waldron.rick at gmail.com
Sun Apr 12 23:53:37 UTC 2015


On Sun, Apr 12, 2015 at 11:59 AM Mark Volkmann <r.mark.volkmann at gmail.com>
wrote:

> I couldn't find this in spec. Is it required for generator functions to
> return an object that is both iterable (has Symbol.iterator method) and an
> iterator (has next method). It seems Babel does this, but I want verify
> whether that is required.
>

The object that's returned by a generator function conforms to both the
Iterator and Iterable interfaces.

-
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iterable-interface
-
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-iterator-interface

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150412/ebb1ab87/attachment-0001.html>


More information about the es-discuss mailing list