fix module specifier default output

This commit is contained in:
Sebastian McKenzie 2015-01-26 13:51:27 +11:00
parent d473826a68
commit 876d88c761

View File

@ -4,8 +4,8 @@ var t = require("../../types");
var _ = require("lodash");
exports.ImportSpecifier = function (node, print) {
if (node.id && node.id.name === "default") {
print(node.name);
if (t.isSpecifierDefault(node)) {
print(t.getSpecifierName(node));
} else {
return exports.ExportSpecifier.apply(this, arguments);
}
@ -71,7 +71,7 @@ exports.ImportDeclaration = function (node, print) {
self.push(", ");
}
var isDefault = spec.id && spec.id.name === "default";
var isDefault = t.isSpecifierDefault(spec);
if (!isDefault && spec.type !== "ImportBatchSpecifier" && !foundImportSpecifier) {
foundImportSpecifier = true;