inherit comments in modules transformer - fixes #280

This commit is contained in:
Sebastian McKenzie
2014-12-11 10:13:40 +11:00
parent 8af05634fa
commit 2537768772

View File

@@ -1,6 +1,12 @@
var t = require("../../types");
var _ = require("lodash");
var inheritsComments = function (node, nodes) {
if (nodes.length) {
t.inheritsComments(nodes[0], node);
}
};
exports.ImportDeclaration = function (node, parent, file) {
var nodes = [];
@@ -12,6 +18,8 @@ exports.ImportDeclaration = function (node, parent, file) {
file.moduleFormatter.import(node, nodes, parent);
}
inheritsComments(node, nodes);
return nodes;
};
@@ -33,5 +41,7 @@ exports.ExportDeclaration = function (node, parent, file) {
});
}
inheritsComments(node, nodes);
return nodes;
};