split up class expressions in export default
This commit is contained in:
@@ -2,13 +2,20 @@
|
||||
|
||||
var t = require("../../../types");
|
||||
|
||||
exports.ExportDeclaration = function (node) {
|
||||
exports.ExportDeclaration = function (node, parent, scope) {
|
||||
var declar = node.declaration;
|
||||
|
||||
if (node.default) {
|
||||
if (t.isClassDeclaration(declar)) {
|
||||
node.declaration = declar.id;
|
||||
return [declar, node];
|
||||
} else if (t.isClassExpression(declar)) {
|
||||
var temp = scope.generateUidIdentifier("default");
|
||||
declar = t.variableDeclaration("var", [
|
||||
t.variableDeclarator(temp, declar)
|
||||
]);
|
||||
node.declaration = temp;
|
||||
return [declar, node];
|
||||
}
|
||||
} else {
|
||||
if (t.isFunctionDeclaration(declar)) {
|
||||
|
||||
Reference in New Issue
Block a user