On 9/26/2013 7:18 PM, Adam Ahmed wrote:
Thanks, I see. The usage is for TaskResult sorts of things where the
scheduling is done via calls to `yield`, and the output of the
function is done via `return`. Fair enough. It still seems like a huge
footgun for the other cases which I'd expect are far more common than
cooperative scheduling, but I can respect that decision.
An example use case is delegating yield:
```js
function* foo() {
yield 'what';
yield 'ever';
return "DONE";
}
function* bar() {
console.log(yield* foo());
}
```
This console.logs "DONE". Can't do this without a way to handle a return
value from generators.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss