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

Side by Side Diff: lib/subscriptionClasses.js

Issue 29573895: Issue 5160 - Alias new class names and properties. (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Oct. 11, 2017, 7:38 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
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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 "use strict"; 18 "use strict";
19 19
20 const {Subscription, SpecialSubscription, DownloadableSubscription} = 20 const {Subscription, UserDefinedSubscription, DownloadableSubscription} =
21 require("compiled"); 21 require("compiled");
22 22
23 /** 23 /**
24 * This property allows iterating over the list of filters. It will delete 24 * This property allows iterating over the list of filters. It will delete
25 * references automatically at the end of the current loop iteration. If you 25 * references automatically at the end of the current loop iteration. If you
26 * need persistent references or element access by position you should use 26 * need persistent references or element access by position you should use
27 * Subscription.filterAt() instead. 27 * Subscription.filterAt() instead.
28 * @type {Iterable} 28 * @type {Iterable}
29 */ 29 */
30 Object.defineProperty(Subscription.prototype, "filters", { 30 Object.defineProperty(Subscription.prototype, "filters", {
(...skipping 13 matching lines...) Expand all
44 finally 44 finally
45 { 45 {
46 filter.delete(); 46 filter.delete();
47 } 47 }
48 } 48 }
49 }.bind(this) 49 }.bind(this)
50 }; 50 };
51 } 51 }
52 }); 52 });
53 53
54 Object.defineProperty(DownloadableSubscription.prototype, "expires", {
55 get()
hub 2017/10/11 19:42:02 I chose to make the aliases non enumerable.
56 {
57 return this.hardExpiration;
58 },
59 set(value)
60 {
61 this.hardExpiration = value;
62 }
63 });
64
65 Object.defineProperty(DownloadableSubscription.prototype, "errors", {
66 get()
67 {
68 return this.errorCount;
69 },
70 set(value)
71 {
72 this.errorCount = value;
73 }
74 });
75
76 Object.defineProperty(DownloadableSubscription.prototype, "version", {
77 get()
78 {
79 return this.dataRevision;
80 },
81 set(value)
82 {
83 this.dataRevision = value;
84 }
85 });
86
54 exports.Subscription = Subscription; 87 exports.Subscription = Subscription;
55 exports.SpecialSubscription = SpecialSubscription; 88 exports.UserDefinedSubscription = UserDefinedSubscription;
89 exports.SpecialSubscription = UserDefinedSubscription;
56 exports.DownloadableSubscription = DownloadableSubscription; 90 exports.DownloadableSubscription = DownloadableSubscription;
OLDNEW

Powered by Google App Engine
This is Rietveld