Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -677,26 +677,17 @@ |
exports.RegExpFilter = RegExpFilter; |
RegExpFilter.prototype = extend(ActiveFilter, { |
/** |
* 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}). |
- * @type {RegExpFilter} |
- */ |
- get 0() |
- { |
- return this; |
- }, |
+ size: 1, |
/** |
* @see ActiveFilter.domainSeparator |
*/ |
domainSeparator: "|", |
/** |
* Expression from which a regular expression should be generated - |
@@ -774,16 +765,25 @@ |
return (this.contentType & typeMask) != 0 && |
(this.thirdParty == null || this.thirdParty == thirdParty) && |
this.isActiveOnDomain(docDomain, sitekey) && |
this.regexp.test(location); |
} |
}); |
/** |
+ * Yields the filter itself (required to optimize {@link Matcher}). |
+ * @yields {RegExpFilter} |
+ */ |
+RegExpFilter.prototype[Symbol.iterator] = function*() |
+{ |
+ yield 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; |
let origText = text; |