some generator issues

Neil Mix nmix at
Mon Apr 23 13:58:12 PDT 2007

On Apr 23, 2007, at 1:18 PM, Brendan Eich wrote:

> A static method would avoid the shadowing problem you raised. It  
> would reflect on the current call stack, presumably finding the top- 
> most generator activation, and extracting the generator-iterator  
> reference (which generally must be kept somewhere reachable from  
> that activation, to keep the generator-iterator alive). It seems  
> slightly more winning to me, but still leaves an odd taste. Thoughts?

It seems inconsistent that the current generator would be fetched via  
a static method on the Generator class, while the current function  
would be fetched via arguments.callee.  Perhaps that's an argument  
for deprecating arguments.callee in favor of a static method on the  
Function class?  So we could have a consistently odd taste.

More information about the Es4-discuss mailing list