Re: Single destructuring argument to an arrow function

2015-03-20 Thread Niloy Mondal
Really awesome if we could have this feature. On Sat, Mar 21, 2015 at 4:04 AM, Brendan Eich bren...@mozilla.org wrote: But we could extend the cover grammar with some work. You'd have to push ArrayLiteral and ObjectLiteral down from PrimaryExpression alternative right-hand sides, to live

Re: Single destructuring argument to an arrow function

2015-03-20 Thread Kevin Smith
But we could extend the cover grammar with some work. You'd have to push ArrayLiteral and ObjectLiteral down from PrimaryExpression alternative right-hand sides, to live under CoverParenthesizedExpressionAndArrowParameterList.Seems do-able -- anyone see a fatal problem? Not for ES6 arrows,

Re: Single destructuring argument to an arrow function

2015-03-20 Thread Rick Waldron
Inline... On Thu, Mar 19, 2015 at 4:50 PM Jan-Ivar Bruaroey j...@mozilla.com wrote: Hi group! First post, so be gentle. Welcome I love how arrow functions allow single arguments to be passed without parenthesis, so I expected this to work: Promise.all([true, false]).then([foo, bar]

Re: Single destructuring argument to an arrow function

2015-03-20 Thread Brendan Eich
But we could extend the cover grammar with some work. You'd have to push ArrayLiteral and ObjectLiteral down from PrimaryExpression alternative right-hand sides, to live under CoverParenthesizedExpressionAndArrowParameterList.Seems do-able -- anyone see a fatal problem? Could be an ES7

Single destructuring argument to an arrow function

2015-03-19 Thread Jan-Ivar Bruaroey
Hi group! First post, so be gentle. I love how arrow functions allow single arguments to be passed without parenthesis, so I expected this to work: Promise.all([true, false]).then([foo, bar] = console.log(foo +”, + bar)); but it doesn't: SyntaxError: invalid arrow-function