Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Issue 882893002: Implement ParseExportDeclaration per latest ES6 spec draft (Closed)

Created:
5 years, 11 months ago by adamk
Modified:
5 years, 10 months ago
CC:
v8-dev, Dmitry Lomov (no reviews)
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Implement ParseExportDeclaration per latest ES6 spec draft One missing feature: anonymous function & class declarations in "export default". BUG=v8:1569 LOG=n R=arv@chromium.org Committed: https://crrev.com/f7dc15febeea78b22de1f57c397a3221a43d9213 Cr-Commit-Position: refs/heads/master@{#26313}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Handled arv comments #

Patch Set 3 : git cl formatted except for test data arrays #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -67 lines) Patch
M src/parser.h View 1 chunk +4 lines, -1 line 0 comments Download
M src/parser.cc View 1 2 5 chunks +125 lines, -36 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 2 chunks +102 lines, -26 lines 0 comments Download
M test/mjsunit/harmony/module-parsing.js View 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 9 (1 generated)
adamk
Here's exports, which seemed like a big enough patch to do at a time. I ...
5 years, 11 months ago (2015-01-28 00:01:54 UTC) #2
adamk
Here's exports, which seemed like a big enough patch to do at a time. I ...
5 years, 11 months ago (2015-01-28 00:01:55 UTC) #3
arv (Not doing code reviews)
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. ...
5 years, 11 months ago (2015-01-28 02:57:19 UTC) #4
adamk
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: On 2015/01/28 02:57:19, arv wrote: > This ...
5 years, 10 months ago (2015-01-28 18:05:04 UTC) #5
adamk
Committed patchset #3 (id:40001) manually as f7dc15febeea78b22de1f57c397a3221a43d9213 (presubmit successful).
5 years, 10 months ago (2015-01-28 19:18:54 UTC) #6
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/f7dc15febeea78b22de1f57c397a3221a43d9213 Cr-Commit-Position: refs/heads/master@{#26313}
5 years, 10 months ago (2015-01-28 19:18:56 UTC) #7
impinball
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): > ...
5 years, 10 months ago (2015-01-29 18:31:03 UTC) #8
adamk
5 years, 10 months ago (2015-01-29 18:34:12 UTC) #9
Message was sent while issue was closed.
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#...
> > 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).

Powered by Google App Engine
This is Rietveld 408576698