Rick Waldron (2013-07-12T14:02:18.000Z)
On Fri, Jul 12, 2013 at 12:22 AM, Andrew Fedoniouk <
news at terrainformatica.com> wrote:

> Quite often I see  constructions like this:
>
> foo({one:1,two:2});
>
> so call of function with single parameter - object literal.
> Idiom named "Poor man named arguments passing"
>
> Idea is to extend existing JS/ES syntax calls to support
> simple form of the call above:
>
> foo {one:1,two:2 };
>
> Semi-formally that syntax looks like:
>
> function-call:
>    <name-token> '(' <parameter-list> ')' // existing form
>    <name-token> <object-literal> // proposal
>

Existing grammar:


  CallExpression Arguments

  Arguments :
    ( )
    ( ArgumentList )


To add ObjectLiteral, at very least the grammar would need to have a
NoLineTerminator between CallExpression and Arguments, which breaks extant
code.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130712/f6e0c9c9/attachment.html>
forbes at lindesay.co.uk (2013-07-12T15:49:55.208Z)
Andrew:
> Semi-formally that syntax looks like:
>
> ```
> function-call:
>    <name-token> '(' <parameter-list> ')' // existing form
>    <name-token> <object-literal> // proposal
> ```

Existing grammar:

```
CallExpression Arguments

Arguments :
  ( )
  ( ArgumentList )
```

To add `ObjectLiteral`, at very least the grammar would need to have a
`NoLineTerminator` between `CallExpression` and `Arguments`, which breaks extant
code.