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

Side by Side 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.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-present eyeo GmbH 3 * Copyright (C) 2006-present eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 { 662 {
663 // Despite this property being cached, the getter is called 663 // Despite this property being cached, the getter is called
664 // several times on Safari, due to WebKit bug 132872 664 // several times on Safari, due to WebKit bug 132872
665 let prop = Object.getOwnPropertyDescriptor(this, "regexp"); 665 let prop = Object.getOwnPropertyDescriptor(this, "regexp");
666 if (prop) 666 if (prop)
667 return prop.value; 667 return prop.value;
668 668
669 let source = Filter.toRegExp(this.regexpSource); 669 let source = Filter.toRegExp(this.regexpSource);
670 let regexp = new RegExp(source, this.matchCase ? "" : "i"); 670 let regexp = new RegExp(source, this.matchCase ? "" : "i");
671 Object.defineProperty(this, "regexp", {value: regexp}); 671 Object.defineProperty(this, "regexp", {value: regexp});
672 delete this.regexpSource;
672 return regexp; 673 return regexp;
673 }, 674 },
674 /** 675 /**
675 * Content types the filter applies to, combination of values from 676 * Content types the filter applies to, combination of values from
676 * RegExpFilter.typeMap 677 * RegExpFilter.typeMap
677 * @type {number} 678 * @type {number}
678 */ 679 */
679 contentType: 0x7FFFFFFF, 680 contentType: 0x7FFFFFFF,
680 /** 681 /**
681 * Defines whether the filter should distinguish between lower and 682 * Defines whether the filter should distinguish between lower and
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1113 */ 1114 */
1114 function ElemHideEmulationFilter(text, domains, selector) 1115 function ElemHideEmulationFilter(text, domains, selector)
1115 { 1116 {
1116 ElemHideBase.call(this, text, domains, selector); 1117 ElemHideBase.call(this, text, domains, selector);
1117 } 1118 }
1118 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; 1119 exports.ElemHideEmulationFilter = ElemHideEmulationFilter;
1119 1120
1120 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { 1121 ElemHideEmulationFilter.prototype = extend(ElemHideBase, {
1121 type: "elemhideemulation" 1122 type: "elemhideemulation"
1122 }); 1123 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld