Agreed in that it's not ambiguous - you have to disambiguate it with a
space for the same reason you have to use `a+ +b` instead of `a++b` in
minified code to avoid ambiguity when specifying `a + +b`. So `a?.b:.c`
would be invalid, but `a? .b:.c` is not.

On Thu, Jun 27, 2019 at 16:48 Bob Myers <r...@gol.com> wrote:

> Not exactly, since the optional chaining operator is `?.` with no space in
> between.
>
> On Thu, Jun 27, 2019 at 1:37 PM Simon Farrugia <simonfarrugi...@gmail.com>
> wrote:
>
>> Also, without a leading token, a selector expr with the optional chaining
>> operator inside a ternary operator would be ambiguous.
>>
>> ```
>>
>> const contactSelector = true ? .contacts.email : .contacts.phone;
>>
>> ```
>>
>>
>> --
-----

Isiah Meadows
cont...@isiahmeadows.com
www.isiahmeadows.com
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to