Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -442,39 +442,27 @@ |
/** |
* Separator character used in domainSource property, must be |
* overridden by subclasses |
* @type {string} |
*/ |
domainSeparator: null, |
/** |
- * Determines whether domainSource is already lower-case, |
- * can be overridden by subclasses. |
- * @type {boolean} |
- */ |
- domainSourceIsLowerCase: false, |
- |
- /** |
* 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() |
{ |
let domains = null; |
if (this.domainSource) |
{ |
- let source = this.domainSource; |
- if (!this.domainSourceIsLowerCase) |
- { |
- // RegExpFilter already have lowercase domains |
- source = source.toLowerCase(); |
- } |
+ let source = this.domainSource.toLowerCase(); |
Jon Sonesen
2018/09/07 03:09:33
Im super happy to see things like this go away heh
Manish Jethani
2018/09/07 03:42:44
I'm guessing "historical reasons." It may have bee
Jon Sonesen
2018/09/17 18:11:33
Yeah makes sense, thanks for explaining. I tested
Sebastian Noack
2018/09/17 19:20:59
This was an optimization at some point, but indeed
|
let knownMap = knownDomainMaps.get(source); |
if (knownMap) |
{ |
domains = knownMap; |
} |
else |
{ |
@@ -685,21 +673,16 @@ |
// No need to convert this filter to regular expression yet, do it on demand |
this.pattern = regexpSource; |
} |
} |
exports.RegExpFilter = RegExpFilter; |
RegExpFilter.prototype = extend(ActiveFilter, { |
/** |
- * @see ActiveFilter.domainSourceIsLowerCase |
- */ |
- domainSourceIsLowerCase: true, |
- |
- /** |
* Number of filters contained, will always be 1 (required to |
* optimize {@link Matcher}). |
* @type {number} |
*/ |
length: 1, |
/** |
* The filter itself (required to optimize {@link Matcher}). |
@@ -864,17 +847,17 @@ |
switch (option.toLowerCase()) |
{ |
case "match-case": |
matchCase = !inverse; |
break; |
case "domain": |
if (!value) |
return new InvalidFilter(origText, "filter_unknown_option"); |
- domains = value.toLowerCase(); |
+ domains = value; |
break; |
case "third-party": |
thirdParty = !inverse; |
break; |
case "collapse": |
collapse = !inverse; |
break; |
case "sitekey": |