create null object when clearing internalRemap instead of using an object inherited plain object - fixes #1489

This commit is contained in:
Sebastian McKenzie
2015-05-09 18:39:59 +01:00
parent 2744b9f31f
commit d38f18af40
5 changed files with 22 additions and 3 deletions

View File

@@ -12,10 +12,10 @@ var remapVisitor = {
}
},
Identifier(node, parent, scope, formatter) {
ReferencedIdentifier(node, parent, scope, formatter) {
var remap = formatter.internalRemap[node.name];
if (this.isReferencedIdentifier() && remap && node !== remap) {
if (remap && node !== remap) {
if (!scope.hasBinding(node.name) || scope.bindingIdentifierEquals(node.name, formatter.localImports[node.name])) {
return remap;
}

View File

@@ -1,5 +1,6 @@
import DefaultFormatter from "./_default";
import AMDFormatter from "./amd";
import object from "../../helpers/object";
import * as util from "../../util";
import last from "lodash/array/last";
import each from "lodash/collection/each";
@@ -143,7 +144,7 @@ export default class SystemFormatter extends AMDFormatter {
]));
}
this.internalRemap = {};
this.internalRemap = object();
this._addImportSource(last(nodes), node);
}

View File

@@ -0,0 +1,2 @@
import toString from "foo";
toString;

View File

@@ -0,0 +1,13 @@
System.register(["foo"], function (_export) {
"use strict";
var toString;
return {
setters: [function (_foo) {
toString = _foo["default"];
}],
execute: function () {
toString;
}
};
});

View File

@@ -0,0 +1,3 @@
{
"modules": "system"
}