fix export default assignment bug
This commit is contained in:
parent
9a3c973280
commit
795183569d
@ -39,10 +39,17 @@ CommonJSFormatter.prototype.export = function (node, nodes) {
|
||||
var declar = node.declaration;
|
||||
|
||||
if (node.default) {
|
||||
t.ensureExpressionType(declar);
|
||||
var ref = declar;
|
||||
|
||||
if (t.isClass(ref) || t.isFunction(ref)) {
|
||||
if (ref.id) {
|
||||
nodes.push(ref);
|
||||
ref = ref.id;
|
||||
}
|
||||
}
|
||||
|
||||
nodes.push(util.template("exports-default", {
|
||||
VALUE: declar
|
||||
VALUE: ref
|
||||
}, true));
|
||||
} else {
|
||||
var id = declar.id;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user