Andy Wingo wrote:
>  function *giveMeAEmptyIterator() {}

Is this valid?

   https://bugs.ecmascript.org/show_bug.cgi?id=1283

(I think it should be, FWIW)

It absolutely should be. See

https://mail.mozilla.org/pipermail/es-discuss/2011-March/013403.html

"""

DaveH's presentation on using generators to write asynchronous code.

How do you compose generators?  yield*

Waldemar: Given yield*, writing base-case trivial generators that
don't yield becomes useful but its syntax is a problem.  Generators
should not be distinguished from functions by the presence of a yield
statement.

"""

This led to the "function*" syntax for generators, to enable empty-bodied generators as the basis cases.

/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to