Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -396,35 +396,39 @@ |
* Map containing domains that this filter should match on/not match |
* on or null if the filter should match on all domains |
* @type {?Map.<string,boolean>} |
*/ |
get domains() |
{ |
// Despite this property being cached, the getter is called |
// several times on Safari, due to WebKit bug 132872 |
- let prop = Object.getOwnPropertyDescriptor(this, "domains"); |
+ let prop = Object.getOwnPropertyDescriptor(this, "_domains"); |
if (prop) |
- return prop.value; |
+ { |
+ let {value} = prop; |
+ return typeof value == "string" ? |
+ new Map([[value, true], ["", false]]) : value; |
+ } |
let domains = null; |
if (this.domainSource) |
{ |
let source = this.domainSource; |
if (!this.domainSourceIsUpperCase) |
{ |
// RegExpFilter already have uppercase domains |
source = source.toUpperCase(); |
} |
let list = source.split(this.domainSeparator); |
if (list.length == 1 && list[0][0] != "~") |
{ |
// Fast track for the common one-domain scenario |
- domains = new Map([["", false], [list[0], true]]); |
+ domains = list[0]; |
} |
else |
{ |
let hasIncludes = false; |
for (let i = 0; i < list.length; i++) |
{ |
let domain = list[i]; |
if (domain == "") |
@@ -449,17 +453,17 @@ |
} |
if (domains) |
domains.set("", !hasIncludes); |
} |
this.domainSource = null; |
} |
- Object.defineProperty(this, "domains", {value: domains, enumerable: true}); |
+ Object.defineProperty(this, "_domains", {value: domains}); |
return this.domains; |
}, |
/** |
* Array containing public keys of websites that this filter should apply to |
* @type {?string[]} |
*/ |
sitekeys: null, |