On Feb 11, 2014, at 5:36 PM, Michael Dyck wrote:
> 
> One thing I still don't understand: why does GeneratorExpression invoke
> BindingIdentifier with Yield but GeneratorDeclaration invokes it without?
> 

Yield doesn't make any sense as the bound name of a GeneratorExpression because 
that binding is only visible within the scope of the GeneratorExpression but 
"yield" can not be used as an identifier within that scope. (I suppose a 
function nested within the generator function could have a up-level reference 
to a GeneratorExpression named 'yield' , bu that is jsut going to be 
confusing...)

The name of a generator function is bound in the surrounding scope, which may 
be a scope where "yield" is a valid identifier.   GeneratorDeclaration looks 
like it needs to have [Yield] parameter telling it whether or not 'yield' is 
allowed in the surrounding scope and  its reference to BindingIdentifier needs 
a [?Yield] . FunctionDeclaration/ClassDeclaration need to be handled similarly. 

Allen


_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to