Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
module: NativeModule._cache turned to a Map
  • Loading branch information
danyshaanan committed Sep 17, 2016
commit da14c6bc14e15cec0a3f9d128f0c7ab0bd8550df
6 changes: 3 additions & 3 deletions lib/internal/bootstrap_node.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@
}

NativeModule._source = process.binding('natives');
NativeModule._cache = {};
NativeModule._cache = new Map();

NativeModule.require = function(id) {
if (id == 'native_module') {
Expand All @@ -429,7 +429,7 @@
};

NativeModule.getCached = function(id) {
return NativeModule._cache[id];
return NativeModule._cache.get(id);
};

NativeModule.exists = function(id) {
Expand Down Expand Up @@ -491,7 +491,7 @@
};

NativeModule.prototype.cache = function() {
NativeModule._cache[this.id] = this;
NativeModule._cache.set(this.id, this);
};

startup();
Expand Down