Hey ES-discuss,
Hi,
For the following code:
for (var i = 0 in {}) { }
We are trying to figure out what grammar productions allow the left hand side
of a for-in statement to have an initializer.
I notice that in the ES5 spec, the following productions can get you there:
IterationStatement :
for ( var VariableDeclarationNoIn in Expression ) Statement
VariableDeclarationNoIn :
Identifier InitialiserNoInopt
But in ES6, all I see is
IterationStatement[Yield, Return] :
for ( var ForBinding[?Yield] in Expression[In, ?Yield] )
Statement[?Yield, ?Return]
ForBinding[Yield] :
BindingIdentifier[?Yield]
BindingPattern[?Yield]
And neither BindingIdentifier or BindingPattern allow an initializer.
Is there a grammar path that I am missing?
Thanks,
Jason
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss