Commit 9f5f3180 authored by neis's avatar neis Committed by Commit bot

[modules] Refactor parsing of anonymous declarations in default exports.

BUG=

Review-Url: https://codereview.chromium.org/2111153002
Cr-Commit-Position: refs/heads/master@{#37474}
parent fe1a07fe
...@@ -267,6 +267,7 @@ class AstValue : public ZoneObject { ...@@ -267,6 +267,7 @@ class AstValue : public ZoneObject {
F(prototype, "prototype") \ F(prototype, "prototype") \
F(return, "return") \ F(return, "return") \
F(set_space, "set ") \ F(set_space, "set ") \
F(star_default_star, "*default*") \
F(this, "this") \ F(this, "this") \
F(this_function, ".this_function") \ F(this_function, ".this_function") \
F(throw, "throw") \ F(throw, "throw") \
......
This diff is collapsed.
...@@ -782,18 +782,15 @@ class Parser : public ParserBase<ParserTraits> { ...@@ -782,18 +782,15 @@ class Parser : public ParserBase<ParserTraits> {
bool* ok); bool* ok);
Statement* ParseFunctionDeclaration(bool* ok); Statement* ParseFunctionDeclaration(bool* ok);
Statement* ParseHoistableDeclaration(ZoneList<const AstRawString*>* names, Statement* ParseHoistableDeclaration(ZoneList<const AstRawString*>* names,
bool* ok); bool default_export, bool* ok);
Statement* ParseHoistableDeclaration(int pos, ParseFunctionFlags flags, Statement* ParseHoistableDeclaration(int pos, ParseFunctionFlags flags,
ZoneList<const AstRawString*>* names, ZoneList<const AstRawString*>* names,
bool* ok); bool default_export, bool* ok);
Statement* ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names, Statement* ParseAsyncFunctionDeclaration(ZoneList<const AstRawString*>* names,
bool* ok); bool default_export, bool* ok);
Expression* ParseAsyncFunctionExpression(bool* ok); Expression* ParseAsyncFunctionExpression(bool* ok);
Statement* ParseFunctionDeclaration(int pos, bool is_generator,
ZoneList<const AstRawString*>* names,
bool* ok);
Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names, Statement* ParseClassDeclaration(ZoneList<const AstRawString*>* names,
bool* ok); bool default_export, bool* ok);
Statement* ParseNativeDeclaration(bool* ok); Statement* ParseNativeDeclaration(bool* ok);
Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok); Block* ParseBlock(ZoneList<const AstRawString*>* labels, bool* ok);
Block* ParseBlock(ZoneList<const AstRawString*>* labels, Block* ParseBlock(ZoneList<const AstRawString*>* labels,
......
...@@ -5510,8 +5510,8 @@ TEST(BasicImportExportParsing) { ...@@ -5510,8 +5510,8 @@ TEST(BasicImportExportParsing) {
"export default function() {}", "export default function() {}",
"export default function*() {}", "export default function*() {}",
"export default class C {}", "export default class C {}",
"export default class {}" "export default class {}",
"export default class extends C {}" "export default class extends C {}",
"export default 42", "export default 42",
"var x; export default x = 7", "var x; export default x = 7",
"export { Q } from 'somemodule.js';", "export { Q } from 'somemodule.js';",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment