Reason why generators do not have references to themselves?
Mark S. Miller
erights at google.com
Thu Jan 23 14:36:32 PST 2014
When writing a generator as, for example, an instance method of a class, it
would be very surprising for its 'this' to be bound to something other than
the class' instance.
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.
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss