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

Unified Diff: lib/filterClasses.js

Issue 29789555: Noissue - Discard regular expression source when no longer needed (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Delete property after adding alternative Created May 25, 2018, 3:42 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 | 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
@@ -664,16 +664,17 @@
// several times on Safari, due to WebKit bug 132872
let prop = Object.getOwnPropertyDescriptor(this, "regexp");
if (prop)
return prop.value;
let source = Filter.toRegExp(this.regexpSource);
let regexp = new RegExp(source, this.matchCase ? "" : "i");
Object.defineProperty(this, "regexp", {value: regexp});
+ delete this.regexpSource;
return regexp;
},
/**
* Content types the filter applies to, combination of values from
* RegExpFilter.typeMap
* @type {number}
*/
contentType: 0x7FFFFFFF,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld