On Thu, May 15, 2014 at 9:17 PM, Rick Waldron <[email protected]>wrote:
> This particular syntax would also require static (a lookahead) and
> semantic (based on the lookahead results) disambiguation to account for
> DecimalLiteral:
>
> var n = .2;
>
True. However, it's a good thing valid identifiers can't start with a
number, otherwise even lookahead couldn't save it. :P
>
>
> If the "." was on the other side?
>
> AccessorAssignmentOperator :
> .= IdentifierName
>
I deliberately avoided that because I've seen it proposed for
Object.extend() syntactic sugar a couple of times:
foo .= {
bar: 1
};
( proposed as doing roughly the same as `_.extend(foo, { bar: 1 });` )
But I have no personal preference either way.
> var string = " a ";
> string .= trim(); // would throw if no `trim` method existed for `string`
>
> string; // "a";
>
>
> Where ".=" means assign the result of "Property Accessors Runtime
> Semantics Evaluation" with lval and rval in appropriate positions (TBH, I'm
> sure I missed something in there)
>
>
> Rick
>
>
- Jussi
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss