Generator return() and exceptions

Allen Wirfs-Brock allen at
Thu Jul 24 10:45:32 PDT 2014

On Jul 24, 2014, at 10:38 AM, Nathan Wall wrote:

> Allen Wirfs-Brock wrote:
> > So going back to my original questions.  Given that we now have return()
> > available to close an abnormally discarded generator, when would somebody
> > (presumably implementing a control abstraction) actually want to apply
> > throw() rather than return() to an iterator?
> Sorry, I may be misunderstanding, but what about the use from Task.js?
> The above should log "from foo".  Wouldn't `throw()` be needed for that?

Right, that's the use case I was lookingor.  Also mentioned by Jeremy in an earlier response.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list