From 876d88c76179d6b38f302c8b87e8bccf4c0d66d7 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Mon, 26 Jan 2015 13:51:27 +1100 Subject: [PATCH] fix module specifier default output --- lib/6to5/generation/generators/modules.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/generation/generators/modules.js b/lib/6to5/generation/generators/modules.js index 6e8a587efb..16cff50fcc 100644 --- a/lib/6to5/generation/generators/modules.js +++ b/lib/6to5/generation/generators/modules.js @@ -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;