On 30 May 2012 05:09, Brendan Eich <[email protected]> wrote:
> Brendan Eich wrote:
>
>> The only usable+secure extensions I see are two, so we don't confuse
>> users with almost-identical syntax with quite different (when it matters
>> most, when under attack) semantics:
>>
>> A. obj.{prop: val, ...} as safe mustache, with : for define not assign.
>>
>> B. obj.[prop = val; ...] with meta... of course, for fluent-style chained
>> assignments of obj's props.
>>
>> I use [ not { for the chained case so the bracketing as well as
>> ;-separation (final ; is optional) and = not : distinguish B from A for
>> readers looking at any punctuation.
>>
>
> Stop me if you've heard this one before...
>
> For B, instead of [] we could use () as the chained set/call brackets. E4X
> (ECMA-357) defines xml.(expr) as a filtering predicate expression, but no
> worries, E4X is going away.
>
So A remains
obj.{x: val, y: val};
...where these are [[DefineOwnProperty]]
and B becomes
obj.(x = val; y = val);
...where these are [[Put]]
Is the idea to _only_ have B, or to have both A and B? I see clear use
cases for B. I'm not immediately seeing them for A but I came late-ish to
the discussion.
-- T.J.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss