On Sat, Jul 13, 2013 at 10:49 PM, Andrew Fedoniouk <
[email protected]> wrote:
> OK, what about this definition then
>
> [name] [no LineTerminator here] [literal object declaration];
>
> So this:
>
> foo.bar {
> one:1,
> two:1
> };
>
> will be parse as a method call: foo.bar {one:1,two:1};
>
> And this:
>
> foo.bar
> {
> one:1,
> two:1
> };
>
> as in case of 'return' will be parsed with ASI in effect:
>
> foo.bar;
> {
> one:1,
> two:1,
> };
>
This is very different to the `return` case in terms of cognitive load.
Associating `return` with "ah, no ASI here" is much simpler than having to
be on the lookup for ASI exceptions almost everywhere.
Also, `return` at least returns, no matter what. Your proposal would make
the newline relevant in an entirely new way: by making it the difference
between having a statement (the `foo.bar`) that's effect-less in most cases
(i.e., if `foo.bar` isn't an effect-ful getter) followed by a block, and a
function call with the block as an argument.
Any other discussions about attempts to transform Java/C/C++/D grammar
> (where '\n' is just a space) to FORTRAN/BASIC-derived line oriented
> grammars
> (Python/Ruby/Lua/etc) I'll left for off-list conversations.
>
Nobody's attempting to do anything of the sort - the ASI rules have been
unchanged for a long time.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss