Index: lib/filterClasses.js |
=================================================================== |
--- a/lib/filterClasses.js |
+++ b/lib/filterClasses.js |
@@ -165,21 +165,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]+)?)*)?$/; |
-/** |
* 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} |
*/ |
@@ -683,17 +678,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 |
*/ |
@@ -718,29 +713,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, this.rewrite != null); |
+ let source = filterToRegExp(this.pattern, this.rewrite != null); |
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, |