Skip to content

Commit

Permalink
Use Object.create(null) in a few more places. (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdalton authored and benjamn committed Mar 18, 2017
1 parent 8ee7b85 commit a4b110d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ var importExportVisitor = new types.PathVisitor.fromMethodsObject({
var dd = decl.declaration;

if (dd) {
var specifierMap = {};
var specifierMap = Object.create(null);
var addNameToMap = function (name) {
addToSpecifierMap(specifierMap, name, name);
};
Expand All @@ -515,7 +515,7 @@ var importExportVisitor = new types.PathVisitor.fromMethodsObject({

if (decl.source) {
if (specifierMap) {
var newMap = {};
var newMap = Object.create(null);

Object.keys(specifierMap).forEach(function (exported) {
specifierMap[exported].forEach(function (local) {
Expand Down Expand Up @@ -637,7 +637,7 @@ function computeSpecifierMap(specifiers) {
}

specifierMap = addToSpecifierMap(
specifierMap || {},
specifierMap || Object.create(null),
__ported,
local
);
Expand Down

0 comments on commit a4b110d

Please sign in to comment.