move doDefaultExportInterop to default module formatter

This commit is contained in:
Sebastian McKenzie 2015-01-26 11:43:46 +11:00
parent b449dbe891
commit 59e3eb2bd1
2 changed files with 4 additions and 4 deletions

View File

@ -27,6 +27,10 @@ function DefaultFormatter(file) {
this.remapAssignments();
}
DefaultFormatter.prototype.doDefaultExportInterop = function (node) {
return node.default && !this.noInteropRequire && !this.hasNonDefaultExports;
};
DefaultFormatter.prototype.bumpImportOccurences = function (node) {
var source = node.source.value;
var occurs = this.localImportOccurences;

View File

@ -60,10 +60,6 @@ CommonJSFormatter.prototype.importDeclaration = function (node, nodes) {
}, true));
};
CommonJSFormatter.prototype.doDefaultExportInterop = function (node) {
return node.default && !this.noInteropRequire && !this.hasNonDefaultExports;
};
CommonJSFormatter.prototype.exportDeclaration = function (node, nodes) {
if (this.doDefaultExportInterop(node)) {
var declar = node.declaration;