| Index: lib/filterClasses.js |
| =================================================================== |
| --- a/lib/filterClasses.js |
| +++ b/lib/filterClasses.js |
| @@ -90,21 +90,16 @@ |
| Filter.knownFilters = new Map(); |
| /** |
| * Regular expression that content filters should match |
| * @type {RegExp} |
| */ |
| Filter.contentRegExp = /^([^/*|@"!]*?)#([@?$])?#(.+)$/; |
| /** |
| - * Regular expression that RegExp filters specified as RegExps should match |
| - * @type {RegExp} |
| - */ |
| -Filter.regexpRegExp = /^(@@)?\/.*\/(?:\$~?[\w-]+(?:=[^,\s]+)?(?:,~?[\w-]+(?:=[^,\s]+)?)*)?$/; |
|
Manish Jethani
2018/09/04 14:50:47
This appears not to be used anywhere and can be re
|
| -/** |
| * Regular expression that options on a RegExp filter should match |
| * @type {RegExp} |
| */ |
| Filter.optionsRegExp = /\$(~?[\w-]+(?:=[^,]*)?(?:,~?[\w-]+(?:=[^,]*)?)*)$/; |
| /** |
| * Regular expression that matches an invalid Content Security Policy |
| * @type {RegExp} |
| */ |
| @@ -608,17 +603,17 @@ |
| // catch syntax errors |
| let regexp = new RegExp(regexpSource.substr(1, regexpSource.length - 2), |
| this.matchCase ? "" : "i"); |
| Object.defineProperty(this, "regexp", {value: regexp}); |
| } |
| else |
| { |
| // No need to convert this filter to regular expression yet, do it on demand |
| - this.regexpSource = regexpSource; |
| + this.pattern = regexpSource; |
| } |
| } |
| exports.RegExpFilter = RegExpFilter; |
| RegExpFilter.prototype = extend(ActiveFilter, { |
| /** |
| * @see ActiveFilter.domainSourceIsLowerCase |
| */ |
| @@ -643,29 +638,28 @@ |
| /** |
| * @see ActiveFilter.domainSeparator |
| */ |
| domainSeparator: "|", |
| /** |
| * Expression from which a regular expression should be generated - |
| * for delayed creation of the regexp property |
| - * @type {string} |
| + * @type {?string} |
| */ |
| - regexpSource: null, |
| + pattern: null, |
| /** |
| * Regular expression to be used when testing against this filter |
| * @type {RegExp} |
| */ |
| get regexp() |
| { |
| - let source = filterToRegExp(this.regexpSource); |
| + let source = filterToRegExp(this.pattern); |
| 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 |
| * @type {number} |
| */ |
| contentType: 0x7FFFFFFF, |