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

Delta Between Two Patch Sets: lib/filterClasses.js

Issue 29789555: Noissue - Discard regular expression source when no longer needed (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Created May 24, 2018, 6:26 a.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 get regexp() 661 get regexp()
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 delete this.regexpSource; 672 delete this.regexpSource;
kzar 2018/05/24 13:43:24 Nit: I'd prefer we did this after the defineProper
Manish Jethani 2018/05/25 03:43:36 Yup, me too.
672 Object.defineProperty(this, "regexp", {value: regexp});
673 return regexp; 673 return regexp;
674 }, 674 },
675 /** 675 /**
676 * Content types the filter applies to, combination of values from 676 * Content types the filter applies to, combination of values from
677 * RegExpFilter.typeMap 677 * RegExpFilter.typeMap
678 * @type {number} 678 * @type {number}
679 */ 679 */
680 contentType: 0x7FFFFFFF, 680 contentType: 0x7FFFFFFF,
681 /** 681 /**
682 * 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
1114 */ 1114 */
1115 function ElemHideEmulationFilter(text, domains, selector) 1115 function ElemHideEmulationFilter(text, domains, selector)
1116 { 1116 {
1117 ElemHideBase.call(this, text, domains, selector); 1117 ElemHideBase.call(this, text, domains, selector);
1118 } 1118 }
1119 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; 1119 exports.ElemHideEmulationFilter = ElemHideEmulationFilter;
1120 1120
1121 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { 1121 ElemHideEmulationFilter.prototype = extend(ElemHideBase, {
1122 type: "elemhideemulation" 1122 type: "elemhideemulation"
1123 }); 1123 });
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld