Revert "make export { foo as default }; trigger common interop"

This reverts commit 07c7b5b419.
This commit is contained in:
Sebastian McKenzie
2015-02-07 19:40:49 +11:00
parent 6a5adfe338
commit e06aac4783
3 changed files with 2 additions and 13 deletions

View File

@@ -27,7 +27,7 @@ function DefaultFormatter(file) {
}
DefaultFormatter.prototype.doDefaultExportInterop = function (node) {
return t.isSpecifierDefault(node) && !this.noInteropRequireExport && !this.hasNonDefaultExports;
return node.default && !this.noInteropRequireExport && !this.hasNonDefaultExports;
};
DefaultFormatter.prototype.bumpImportOccurences = function (node) {

View File

@@ -64,17 +64,6 @@ CommonJSFormatter.prototype.importDeclaration = function (node, nodes) {
}, true));
};
CommonJSFormatter.prototype.exportSpecifier = function (specifier, node, nodes) {
if (this.doDefaultExportInterop(node)) {
nodes.push(util.template("exports-default-assign", {
VALUE: t.getSpecifierId(specifier)
}, true));
return;
}
DefaultFormatter.prototype.exportSpecifier.apply(this, arguments);
};
CommonJSFormatter.prototype.exportDeclaration = function (node, nodes) {
if (this.doDefaultExportInterop(node)) {
var declar = node.declaration;

View File

@@ -760,7 +760,7 @@ t.getSpecifierId = function (specifier) {
*/
t.isSpecifierDefault = function (specifier) {
return specifier.default || t.isIdentifier(specifier.id, { name: "default" });
return specifier.default || t.isIdentifier(specifier.id) && specifier.id.name === "default";
};
toFastProperties(t);