On May 30, 2012, at 6:16 AM, Brendan Eich wrote:
>> ...
>
> See later post suggesting obj.(foo = 1; bar = 2; baz()).
>
> Non-Identifier property names would be a hard case, I think. You'd have to
> write things out the long way using obj['fo@o'), etc.
I don't think it is very hard:
MemberExpression :
MemberExpression . ( CascadeList )
...
CascadeList :
Cascade
CascadeList ; Cascade
Cascade :
PropertyName = AssignmentExpression
PropertyName Arguments
PropertyName .( CascadeList )
where all the non-terminals not explicitly specified above have there current
(future) ES5/6 definitions. In particular:
PropertyName :
IdentifierName
StringLiteral
NumericLiteral
@ Identifier //a hypothetical new addition for private name
I don't yet love using parens in this way, but it seems that it could work for
all of these cascade forms
Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss