diff --git a/src/babel/transformation/modules/_default.js b/src/babel/transformation/modules/_default.js index 592890887c..2d36ccb78f 100644 --- a/src/babel/transformation/modules/_default.js +++ b/src/babel/transformation/modules/_default.js @@ -106,12 +106,12 @@ var exportsVisitor = traverse.explode({ export default class DefaultFormatter { constructor(file) { - this.internalRemap = {}; this.defaultIds = object(); this.scope = file.scope; this.file = file; this.ids = object(); + this.internalRemap = object(); this.hasNonDefaultExports = false; diff --git a/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/actual.js b/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/actual.js new file mode 100644 index 0000000000..9fa4842a8e --- /dev/null +++ b/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/actual.js @@ -0,0 +1,2 @@ +import toString from "foo"; +toString; diff --git a/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/expected.js b/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/expected.js new file mode 100644 index 0000000000..935f40aa45 --- /dev/null +++ b/test/core/fixtures/transformation/misc/regression-lodash-tostring-import/expected.js @@ -0,0 +1,9 @@ +"use strict"; + +var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; }; + +var _toString = require("foo"); + +var toString = _interopRequire(_toString); + +toString;