Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -621,22 +621,31 @@ |
RegExpFilter.prototype = extend(ActiveFilter, { |
/** |
* @see ActiveFilter.domainSourceIsLowerCase |
*/ |
domainSourceIsLowerCase: true, |
/** |
* Number of filters contained, will always be 1 (required to |
- * optimize Matcher). |
+ * optimize {@link Matcher}). |
* @type {number} |
*/ |
length: 1, |
/** |
+ * The filter itself (required to optimize {@link Matcher}). |
+ * @type {RegExpFilter} |
+ */ |
+ get 0() |
+ { |
+ return this; |
+ }, |
+ |
+ /** |
* @see ActiveFilter.domainSeparator |
*/ |
domainSeparator: "|", |
/** |
* Expression from which a regular expression should be generated - |
* for delayed creation of the regexp property |
* @type {string} |
@@ -715,21 +724,16 @@ |
this.isActiveOnDomain(docDomain, sitekey) && this.regexp.test(location)) |
{ |
return true; |
} |
return false; |
} |
}); |
-// Required to optimize Matcher, see also RegExpFilter.prototype.length |
-Object.defineProperty(RegExpFilter.prototype, "0", { |
- get() { return this; } |
-}); |
- |
/** |
* Creates a RegExp filter from its text representation |
* @param {string} text same as in Filter() |
* @return {Filter} |
*/ |
RegExpFilter.fromText = function(text) |
{ |
let blocking = true; |