One of the stated advantages of the proposal is that because it is syntax
driven it allows for static error messages limiting some bugs.

Using a method would not give the same degree of certainty of correctness
as that would require assertions to be deferred to runtime, since
EcmaScript is not statically typed.

I think there could be other alternatives for the operator but I agree with
the original proposal that it is good to use syntax for this use case.

2017年7月30日(日) 9:06 Naveen Chawla <[email protected]>:

> I don't like the # symbol there.
>
> I would prefer something like Map.fromObject({ 'myKey': {}, myKey2: [] });
> etc.
>
> On Sun, 30 Jul 2017 at 02:51 Alexander Jones <[email protected]> wrote:
>
>> As a follow-up to https://esdiscuss.org/topic/map-literal I've finally
>> (2 years? Really?) written up a proposal for extensible collection
>> "literal" syntax (for Map, Set, Immutable.List, etc.)
>>
>> https://github.com/alex-weej/es-extensible-collection-literal
>>
>> Thanks
>>
>> Alex
>> _______________________________________________
>> es-discuss mailing list
>> [email protected]
>> https://mail.mozilla.org/listinfo/es-discuss
>>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to