From da14c6bc14e15cec0a3f9d128f0c7ab0bd8550df Mon Sep 17 00:00:00 2001 From: Dany Shaanan Date: Sat, 17 Sep 2016 10:08:55 +0200 Subject: [PATCH] module: NativeModule._cache turned to a Map --- lib/internal/bootstrap_node.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 17e34f40361235..093bca1552630b 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -402,7 +402,7 @@ } NativeModule._source = process.binding('natives'); - NativeModule._cache = {}; + NativeModule._cache = new Map(); NativeModule.require = function(id) { if (id == 'native_module') { @@ -429,7 +429,7 @@ }; NativeModule.getCached = function(id) { - return NativeModule._cache[id]; + return NativeModule._cache.get(id); }; NativeModule.exists = function(id) { @@ -491,7 +491,7 @@ }; NativeModule.prototype.cache = function() { - NativeModule._cache[this.id] = this; + NativeModule._cache.set(this.id, this); }; startup();