Index: lib/elemHide.js |
diff --git a/lib/elemHide.js b/lib/elemHide.js |
index e9243853e3733c83632710b690e69224f1983bea..a6d2c5a7a27c05e91a0186320b560f3db405e721 100644 |
--- a/lib/elemHide.js |
+++ b/lib/elemHide.js |
@@ -66,8 +66,7 @@ let unconditionalFilterKeys = null; |
/** |
* Object to be used instead when a filter has a blank domains property. |
*/ |
-let defaultDomains = Object.create(null); |
-defaultDomains[""] = true; |
+let defaultDomains = new Map([["", true]]); |
/** |
* Lookup table, keys are known element hiding exceptions |
@@ -104,13 +103,13 @@ let ElemHide = exports.ElemHide = { |
_addToFiltersByDomain(key, filter) |
{ |
let domains = filter.domains || defaultDomains; |
- for (let domain in domains) |
+ for (let [domain, isIncluded] of domains) |
{ |
let filters = filtersByDomain[domain]; |
if (!filters) |
filters = filtersByDomain[domain] = Object.create(null); |
- if (domains[domain]) |
+ if (isIncluded) |
filters[key] = filter; |
else |
filters[key] = false; |
@@ -182,7 +181,7 @@ let ElemHide = exports.ElemHide = { |
// We haven't found this filter in unconditional filters, look in |
// filtersByDomain. |
let domains = filter.domains || defaultDomains; |
- for (let domain in domains) |
+ for (let domain of domains.keys()) |
{ |
let filters = filtersByDomain[domain]; |
if (filters) |