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

Side by Side Diff: lib/filterClasses.js

Issue 29852555: Issue 6559 - Convert subscriptions property of Filter to a set (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Aug. 10, 2018, 2:12 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 | lib/filterListener.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 22 matching lines...) Expand all
33 33
34 /** 34 /**
35 * Abstract base class for filters 35 * Abstract base class for filters
36 * 36 *
37 * @param {string} text string representation of the filter 37 * @param {string} text string representation of the filter
38 * @constructor 38 * @constructor
39 */ 39 */
40 function Filter(text) 40 function Filter(text)
41 { 41 {
42 this.text = text; 42 this.text = text;
43 this.subscriptions = []; 43 this.subscriptions = new Set();
44 } 44 }
45 exports.Filter = Filter; 45 exports.Filter = Filter;
46 46
47 Filter.prototype = 47 Filter.prototype =
48 { 48 {
49 /** 49 /**
50 * String representation of the filter 50 * String representation of the filter
51 * @type {string} 51 * @type {string}
52 */ 52 */
53 text: null, 53 text: null,
54 54
55 /** 55 /**
56 * Filter subscriptions the filter belongs to 56 * Filter subscriptions the filter belongs to
57 * @type {Subscription[]} 57 * @type {Set.<Subscription>}
58 */ 58 */
59 subscriptions: null, 59 subscriptions: null,
60 60
61 /** 61 /**
62 * Filter type as a string, e.g. "blocking". 62 * Filter type as a string, e.g. "blocking".
63 * @type {string} 63 * @type {string}
64 */ 64 */
65 get type() 65 get type()
66 { 66 {
67 throw new Error("Please define filter type in the subclass"); 67 throw new Error("Please define filter type in the subclass");
(...skipping 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 1187
1188 /** 1188 /**
1189 * Script that should be executed 1189 * Script that should be executed
1190 * @type {string} 1190 * @type {string}
1191 */ 1191 */
1192 get script() 1192 get script()
1193 { 1193 {
1194 return this.body; 1194 return this.body;
1195 } 1195 }
1196 }); 1196 });
OLDNEW
« no previous file with comments | « no previous file | lib/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld