Re: Why can’t for-of be applied to iterators?

Allen Wirfs-Brock allen at wirfs-brock.com
Wed Jun 12 09:17:31 PDT 2013


On Jun 12, 2013, at 8:30 AM, Andy Wingo wrote:

> On Wed 12 Jun 2013 17:17, Jason Orendorff <jason.orendorff at gmail.com> writes:
> 
>> function *giveMeAEmptyIterator() {}
> 
> Is this valid?
> 
>  https://bugs.ecmascript.org/show_bug.cgi?id=1283
> 
> (I think it should be, FWIW)

Unless there are objections, I intend to "fix" this bug and make the occurrence of yield within a generator function optional.  The restriction is really a carry over from the days before the * was added to the function definition.  At that time the occurrence of yield in the body was what made a function definition a generator function definition.

Allen



More information about the es-discuss mailing list