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

Unified Diff: lib/filterClasses.js

Issue 29869574: Issue 6883 - Use filterToRegExp in lib/filterClasses.js (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 30, 2018, 4:22 p.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 | no next file » | 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
@@ -224,21 +224,16 @@
else
options[i] = option.replace(/ +/g, "");
}
return beforeOptions + "$" + options.join();
};
/**
- * @see filterToRegExp
- */
-Filter.toRegExp = filterToRegExp;
-
-/**
* Class for invalid filters
* @param {string} text see {@link Filter Filter()}
* @param {string} reason Reason why this filter is invalid
* @constructor
* @augments Filter
*/
function InvalidFilter(text, reason)
{
@@ -648,17 +643,17 @@
*/
regexpSource: null,
/**
* Regular expression to be used when testing against this filter
* @type {RegExp}
*/
get regexp()
{
- let source = Filter.toRegExp(this.regexpSource);
+ let source = filterToRegExp(this.regexpSource);
let regexp = new RegExp(source, this.matchCase ? "" : "i");
Object.defineProperty(this, "regexp", {value: regexp});
this.regexpSource = null;
return regexp;
},
/**
* Content types the filter applies to, combination of values from
* RegExpFilter.typeMap
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld