Re: ES6 spec: `export default` HoistableDeclaration

2014-11-27 Thread Axel Rauschmayer
Interesting that that matters. I wouldn’t have thought so – given that modules export references, not values. On 20 Nov 2014, at 01:54, Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Nov 19, 2014, at 4:42 PM, Axel Rauschmayer a...@rauschma.de wrote: OK, I take it the following

ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Axel Rauschmayer
Quoting https://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports `export default` HoistableDeclaration `export default` [lookahead ≠ `function`] AssignmentExpression `;` Questions: * Do these grammar rules mean that you have to put anonymous function expressions in parentheses? Is

Re: ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Allen Wirfs-Brock
On Nov 19, 2014 6:54 AM, Axel Rauschmayer a...@rauschma.de wrote: Quoting https://people.mozilla.org/~jorendorff/es6-draft.html#sec-exports `export default` HoistableDeclaration Note that the actual spec. text has a [Default] grammar parameter after HoistableDeclaration. That,'s important.

Re: ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Axel Rauschmayer
* Do these grammar rules mean that you have to put anonymous function expressions in parentheses? Is that desirable (given that it’s a frequent use case)? No, HoistableDeclaration[Default] includes FunctionDeclaration that lacks a BindingIdentifier. OK, I take it the following wasn’t

Re: ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Allen Wirfs-Brock
On Nov 19, 2014, at 1:59 PM, Axel Rauschmayer a...@rauschma.de wrote: * Do these grammar rules mean that you have to put anonymous function expressions in parentheses? Is that desirable (given that it’s a frequent use case)? No, HoistableDeclaration[Default] includes FunctionDeclaration

Re: ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Axel Rauschmayer
OK, I take it the following wasn’t viable? that’s correct. We wanted the initialization of a function like: export default function () {} to be hoisted, just like: export function f() {}; I suspect that that will confuse people: they will expect an anonymous function to be an

Re: ES6 spec: `export default` HoistableDeclaration

2014-11-19 Thread Allen Wirfs-Brock
On Nov 19, 2014, at 4:42 PM, Axel Rauschmayer a...@rauschma.de wrote: OK, I take it the following wasn’t viable? that’s correct. We wanted the initialization of a function like: export default function () {} to be hoisted, just like: export function f() {}; I suspect that that