fix export default declarations
This commit is contained in:
parent
3e676a0183
commit
d727f97497
11
acorn.js
11
acorn.js
@ -3183,10 +3183,13 @@
|
||||
} else
|
||||
// export default ...;
|
||||
if (eat(_default)) {
|
||||
if (tokType === _function || tokType === _class) {
|
||||
node.declaration = parseStatement();
|
||||
} else {
|
||||
node.declaration = parseExpression(true);
|
||||
var declar = node.declaration = parseExpression(true);
|
||||
if (declar.id) {
|
||||
if (declar.type === "FunctionExpression") {
|
||||
declar.type = "FunctionDeclaration";
|
||||
} else if (declar.type === "ClassExpression") {
|
||||
declar.type = "ClassDeclaration";
|
||||
}
|
||||
}
|
||||
node['default'] = true;
|
||||
node.specifiers = null;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
"name": "acorn-6to5",
|
||||
"description": "Acorn fork used by 6to5",
|
||||
"main": "acorn.js",
|
||||
"version": "0.9.1-15",
|
||||
"version": "0.9.1-16",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Marijn Haverbeke",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user