On Fri, Jul 12, 2013 at 2:06 PM, Rick Waldron <[email protected]> wrote:
>
>
>
> On Fri, Jul 12, 2013 at 1:42 PM, Andrew Fedoniouk
> <[email protected]> wrote:
>>
...
>>
>> This construction
>>
>>   foo {};
>>
>> is an equivalent of:
>>
>>   foo({});
>>
>> but not
>>
>>   foo();
>
>
>
> Right, I get that... but what I'm telling you is that your proposal doesn't
> work:
>
>   foo {}
>
> Same as
>
>   foo({})
>
>
> So, that means:
>
> foo
> {}
>
> should be the same as
>
> foo
> ({})
>
> ...Because this is a valid function call.
>
> But it's not the same and cannot be defined as the same, because ASI put a
> semi colon at the end of |foo| and {} is a valid empty block. Changing this
> would surely be web breaking.
>

Seems like I am not getting that famous ASI thing.

I do not understand why here:

  foo
  (exp);

there is no semicolon injected. It rather should be this:

  foo;
  (exp);

if that ASI thing has any traces of logic behind.


BTW: what about "use strict" ? Does it govern ASI parsing rules?
If not then why?
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to