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