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

Side by Side Diff: lib/filterClasses.js

Issue 29863579: Issue 6868 - Enable capturing of surrounding wildcards for rewrite filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase Created Sept. 1, 2018, 2:49 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 | « lib/common.js ('k') | test/filterClasses.js » ('j') | 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 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 * for delayed creation of the regexp property 641 * for delayed creation of the regexp property
642 * @type {string} 642 * @type {string}
643 */ 643 */
644 regexpSource: null, 644 regexpSource: null,
645 /** 645 /**
646 * Regular expression to be used when testing against this filter 646 * Regular expression to be used when testing against this filter
647 * @type {RegExp} 647 * @type {RegExp}
648 */ 648 */
649 get regexp() 649 get regexp()
650 { 650 {
651 let source = filterToRegExp(this.regexpSource); 651 let source = filterToRegExp(this.regexpSource, this.rewrite == null);
652 let regexp = new RegExp(source, this.matchCase ? "" : "i"); 652 let regexp = new RegExp(source, this.matchCase ? "" : "i");
653 Object.defineProperty(this, "regexp", {value: regexp}); 653 Object.defineProperty(this, "regexp", {value: regexp});
654 this.regexpSource = null; 654 this.regexpSource = null;
655 return regexp; 655 return regexp;
656 }, 656 },
657 /** 657 /**
658 * Content types the filter applies to, combination of values from 658 * Content types the filter applies to, combination of values from
659 * RegExpFilter.typeMap 659 * RegExpFilter.typeMap
660 * @type {number} 660 * @type {number}
661 */ 661 */
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1177
1178 /** 1178 /**
1179 * Script that should be executed 1179 * Script that should be executed
1180 * @type {string} 1180 * @type {string}
1181 */ 1181 */
1182 get script() 1182 get script()
1183 { 1183 {
1184 return this.body; 1184 return this.body;
1185 } 1185 }
1186 }); 1186 });
OLDNEW
« no previous file with comments | « lib/common.js ('k') | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld