instantiating generators

Brendan Eich brendan at mozilla.com
Fri Mar 15 21:48:27 PDT 2013


Andrea Giammarchi wrote:
> I agree on that and on top I would rather throw if `new` is used ...

That might be ok. The newborn passed in as this could be returned via 
first yield, though, so while it's an odd thing to take advantage of, 
the semantics of new and function* combine without harm.

/be


More information about the es-discuss mailing list