Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/filterClasses.js

Issue 29892596: Issue 6992 - Remove keyword-by-filter map (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 27, 2018, 4:23 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/matcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | lib/matcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld