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

Side by Side Diff: lib/filterClasses.js

Issue 29790626: Noissue - Avoid delete operator on RegExpFilter.regexpSource (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created May 25, 2018, 10:20 p.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 this.regexpSource = null;
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 });
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