From 00b22b12312db30d0fb4c6c9a2a861be98d38c51 Mon Sep 17 00:00:00 2001 From: Sebastian McKenzie Date: Fri, 30 Jan 2015 00:13:37 +1100 Subject: [PATCH] don't ignore dynamic import specifiers - fixes #633 --- lib/6to5/transformation/modules/amd.js | 3 +-- .../transformation/self-contained/runtime-amd/expected.js | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/6to5/transformation/modules/amd.js b/lib/6to5/transformation/modules/amd.js index f4d7713954..00d60a7077 100644 --- a/lib/6to5/transformation/modules/amd.js +++ b/lib/6to5/transformation/modules/amd.js @@ -82,8 +82,7 @@ AMDFormatter.prototype.importSpecifier = function (specifier, node, nodes) { if (contains(this.file.dynamicImported, node)) { // Prevent unnecessary renaming of dynamic imports. - this.ids[node.source.value] = key; - return; + this.ids[node.source.value] = ref; } else if (t.isImportBatchSpecifier(specifier)) { // import * as bar from "foo"; } else if (t.isSpecifierDefault(specifier) && !this.noInteropRequire) { diff --git a/test/fixtures/transformation/self-contained/runtime-amd/expected.js b/test/fixtures/transformation/self-contained/runtime-amd/expected.js index 89885bdb66..169a62020f 100644 --- a/test/fixtures/transformation/self-contained/runtime-amd/expected.js +++ b/test/fixtures/transformation/self-contained/runtime-amd/expected.js @@ -1,5 +1,6 @@ -define(["exports", "someModule", "6to5-runtime/helpers"], function (exports, _someModule, _to5Helpers) { +define(["exports", "someModule", "6to5-runtime/helpers"], function (exports, _someModule, _to5RuntimeHelpers) { "use strict"; + var _to5Helpers = _to5RuntimeHelpers; var foo = _to5Helpers.interopRequire(_someModule); });