Index: lib/elemHide.js |
diff --git a/lib/elemHide.js b/lib/elemHide.js |
index a6d2c5a7a27c05e91a0186320b560f3db405e721..fc2226343341a5a9859c108faaa51309f2efe483 100644 |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -39,9 +39,9 @@ let keyByFilter = Object.create(null); |
/** |
* Nested lookup table, filter (or false if inactive) by filter key by domain. |
* (Only contains filters that aren't unconditionally matched for all domains.) |
- * @type {Object} |
+ * @type {Map.<string,Object>} |
*/ |
-let filtersByDomain = Object.create(null); |
+let filtersByDomain = new Map(); |
/** |
* Lookup table, filter key by selector. (Only used for selectors that are |
@@ -92,7 +92,7 @@ let ElemHide = exports.ElemHide = { |
{ |
filterByKey = []; |
keyByFilter = Object.create(null); |
- filtersByDomain = Object.create(null); |
+ filtersByDomain = new Map(); |
filterKeyBySelector = Object.create(null); |
unconditionalSelectors = unconditionalFilterKeys = null; |
knownExceptions = Object.create(null); |
@@ -105,9 +105,9 @@ let ElemHide = exports.ElemHide = { |
let domains = filter.domains || defaultDomains; |
for (let [domain, isIncluded] of domains) |
{ |
- let filters = filtersByDomain[domain]; |
+ let filters = filtersByDomain.get(domain); |
if (!filters) |
- filters = filtersByDomain[domain] = Object.create(null); |
+ filtersByDomain.set(domain, filters = Object.create(null)); |
sergei
2017/09/21 12:00:26
filters are changed in https://codereview.adblockp
|
if (isIncluded) |
filters[key] = filter; |
@@ -183,7 +183,7 @@ let ElemHide = exports.ElemHide = { |
let domains = filter.domains || defaultDomains; |
for (let domain of domains.keys()) |
{ |
- let filters = filtersByDomain[domain]; |
+ let filters = filtersByDomain.get(domain); |
if (filters) |
delete filters[key]; |
} |
@@ -362,7 +362,7 @@ let ElemHide = exports.ElemHide = { |
if (specificOnly && currentDomain == "") |
break; |
- let filters = filtersByDomain[currentDomain]; |
+ let filters = filtersByDomain.get(currentDomain); |
if (filters) |
{ |
for (let filterKey in filters) |