Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 4, 2020
1 parent f452154 commit 44a3486
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/babel-parser/src/parser/statement.js
Expand Up @@ -1931,7 +1931,8 @@ export default class StatementParser extends ExpressionParser {
if (
declaration.type === "Identifier" &&
declaration.name === "from" &&
declaration.end - declaration.start === 4 // does not contain escape
declaration.end - declaration.start === 4 && // does not contain escape
!declaration.extra?.parenthesized
) {
this.raise(declaration.start, Errors.ExportDefaultFromAsIdentifier);
}
Expand Down
@@ -0,0 +1 @@
export default (from);
@@ -0,0 +1,4 @@
{
"plugins": ["exportDefaultFrom"],
"sourceType": "module"
}
@@ -0,0 +1,26 @@
{
"type": "File",
"start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}},
"program": {
"type": "Program",
"start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}},
"sourceType": "module",
"interpreter": null,
"body": [
{
"type": "ExportDefaultDeclaration",
"start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}},
"declaration": {
"type": "Identifier",
"start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"from"},
"name": "from",
"extra": {
"parenthesized": true,
"parenStart": 15
}
}
}
],
"directives": []
}
}

0 comments on commit 44a3486

Please sign in to comment.