Merge pull request babel/babel-eslint#50 from UltCombo/fix-48
acorn-to-esprima: fix ExportNamedDeclaration, closes babel/babel-eslint#48
This commit is contained in:
parent
0d0cc6bb83
commit
ce91f1869b
@ -85,7 +85,7 @@ var astTransformVisitor = {
|
|||||||
} else if (node.declaration.type === "ClassExpression") {
|
} else if (node.declaration.type === "ClassExpression") {
|
||||||
node.declaration.type = "ClassDeclaration";
|
node.declaration.type = "ClassDeclaration";
|
||||||
}
|
}
|
||||||
} else if (t.isExportBatchSpecifier(node.specifiers[0])) {
|
} else if (node.specifiers && t.isExportBatchSpecifier(node.specifiers[0])) {
|
||||||
node.type = "ExportAllDeclaration";
|
node.type = "ExportAllDeclaration";
|
||||||
delete node.specifiers;
|
delete node.specifiers;
|
||||||
delete node.declaration;
|
delete node.declaration;
|
||||||
@ -94,7 +94,7 @@ var astTransformVisitor = {
|
|||||||
}
|
}
|
||||||
delete node.default;
|
delete node.default;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (t.isExportSpecifier(node)) {
|
if (t.isExportSpecifier(node)) {
|
||||||
node.local = node.id;
|
node.local = node.id;
|
||||||
node.exported = node.name || node.id;
|
node.exported = node.name || node.id;
|
||||||
@ -133,7 +133,7 @@ var astTransformVisitor = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// functions
|
// functions
|
||||||
|
|
||||||
if (t.isFunction(node)) {
|
if (t.isFunction(node)) {
|
||||||
node.defaults = [];
|
node.defaults = [];
|
||||||
node.params = node.params.map(function (param) {
|
node.params = node.params.map(function (param) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user