Reason why generators do not have references to themselves?

Andrea Giammarchi andrea.giammarchi at gmail.com
Thu Jan 23 15:30:11 PST 2014


arguments.callee.caller would have done that </trolling>
</but-actually-not-so-much>


On Thu, Jan 23, 2014 at 2:14 PM, Bradley Meck <bradley.meck at gmail.com>wrote:

> I was playing around with generators / looking at await for promises and
> notices a very difficult thing revolving around generators not having a
> reference to themselves.
>
> See:
>
> https://gist.github.com/bmeck/72a0f4f448f20cf00f8c
>
> I have to end up wrapping the generator function to get a reference to the
> generator for passing to nested functions.
>
> Is there a reason the execution context is not a generator / there is no
> reference back to the generator during [[call]]?
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140123/8651eff3/attachment.html>


More information about the es-discuss mailing list