Is that true even though then should fire after the generator unwinds its
stack? I am using regenerator right now while playing with this stuff.
On Jan 23, 2014 5:43 PM, "Brendan Eich" <[email protected]> wrote:
> Andrea Giammarchi wrote:
>
>> arguments.callee.caller would have done that </trolling>
>> </but-actually-not-so-much>
>>
>
> No, Bradley wants the generator-iterator (what ES6 draft calls a
> Generator), not the generator function (GeneratorFunction). Any .callee
> would have to be a function, so a GeneratorFunction.
>
> But the gist'ed example won't work:
>
> function* doLogin_() {
> try {
> /* START ASYNC TRANSPILE */
> login(req).then(function (session) {
> gen.next(session);
>
>
> You can't next an active generator.
>
> Instead, the trick is to avoid promises inside the generator function. Put
> them "on the outside" (and "backstage") as task.js does.
> http://taskjs.org/.
>
> /be
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss