On 2015/01/29 18:31:03, impinball wrote:
On 2015/01/28 02:57:19, arv wrote:
> LGTM
>
> https://codereview.chromium.org/882893002/diff/1/src/parser.cc
> File src/parser.cc (right):
>
> https://codereview.chromium.org/882893002/diff/1/src/parser.cc#newcode1384
> src/parser.cc:1384: case Token::FUNCTION:
> This is going to be problematic. export default supports exporting function
> expressions too.
>
> ```js
> export default function() {}
> ```
>
> We need to do some lookahead that is currently not covered by the current
code.
>
> Can you add a TODO?
>
> https://codereview.chromium.org/882893002/diff/1/src/parser.cc#newcode1389
> src/parser.cc:1389: result = ParseClassDeclaration(NULL, CHECK_OK);
> Same here
>
> https://codereview.chromium.org/882893002/diff/1/test/cctest/test-parsing.cc
> File test/cctest/test-parsing.cc (right):
>
>

https://codereview.chromium.org/882893002/diff/1/test/cctest/test-parsing.cc#newcode4747
> test/cctest/test-parsing.cc:4747: "var a; export { a",
> Add test for `export {,}`?

@arv, you can also default export a named function. These two are equivalent:

```js
export default function foo() {}

function foo() {}
export default foo;
```

I'm aware that this is already committed, but it's just a note for the future.

I don't think there was any confusion about that. The point arv was raising was that the committed code does not support the anonymous version, but does support
both

export default function foo() {}

and

function foo() {}
export default foo

(via the ParseAssignmentExpression production).

https://codereview.chromium.org/882893002/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to