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

Delta Between Two Patch Sets: lib/subscriptionClasses.js

Issue 29900557: Issue 7016 - Convert serialization functions into generators (Closed)
Left Patch Set: Address PS5 Comments Created Oct. 22, 2018, 10:58 p.m.
Right Patch Set: Actually address nits Created Oct. 23, 2018, 3:21 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 | « lib/filterStorage.js ('k') | test/filterClasses.js » ('j') | 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 if (value != this._disabled) 118 if (value != this._disabled)
119 { 119 {
120 let oldValue = this._disabled; 120 let oldValue = this._disabled;
121 this._disabled = value; 121 this._disabled = value;
122 filterNotifier.emit("subscription.disabled", this, value, oldValue); 122 filterNotifier.emit("subscription.disabled", this, value, oldValue);
123 } 123 }
124 return this._disabled; 124 return this._disabled;
125 }, 125 },
126 126
127 /** 127 /**
128 * Serializes the subscription for writing out on the disk. 128 * Serializes the subscription for writing out on disk.
Manish Jethani 2018/10/23 03:02:18 Nit: "on the disk" ... we could lose the "the" (it
Jon Sonesen 2018/10/23 03:13:55 Done.
129 * @yields {string} 129 * @yields {string}
130 */ 130 */
131 *serialize() 131 *serialize()
132 { 132 {
133 let {url, type, _title, _fixedTitle, _disabled} = this; 133 let {url, type, _title, _fixedTitle, _disabled} = this;
134 134
135 yield "[Subscription]"; 135 yield "[Subscription]";
136 yield "url=" + url; 136 yield "url=" + url;
137 137
138 if (type) 138 if (type)
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 /** 284 /**
285 * See Subscription.serialize() 285 * See Subscription.serialize()
286 * @inheritdoc 286 * @inheritdoc
287 */ 287 */
288 *serialize() 288 *serialize()
289 { 289 {
290 let {defaults, _lastDownload} = this; 290 let {defaults, _lastDownload} = this;
291 291
292 yield* Subscription.prototype.serialize.call(this); 292 yield* Subscription.prototype.serialize.call(this);
293 293
294 if (defaults && defaults.length) 294 if (defaults)
Manish Jethani 2018/10/23 03:02:18 Thinking about related changes now, we don't need
Jon Sonesen 2018/10/23 03:13:55 Done.
Manish Jethani 2018/10/23 03:15:59 You made the change in the wrong place :)
295 { 295 {
296 yield "defaults=" + 296 yield "defaults=" +
297 defaults.filter( 297 defaults.filter(
298 type => SpecialSubscription.defaultsMap.has(type) 298 type => SpecialSubscription.defaultsMap.has(type)
299 ).join(" "); 299 ).join(" ");
300 } 300 }
301 if (_lastDownload) 301 if (_lastDownload)
302 yield "lastDownload=" + _lastDownload; 302 yield "lastDownload=" + _lastDownload;
303 } 303 }
304 }); 304 });
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
582 if (errors) 582 if (errors)
583 yield "errors=" + errors; 583 yield "errors=" + errors;
584 if (version) 584 if (version)
585 yield "version=" + version; 585 yield "version=" + version;
586 if (requiredVersion) 586 if (requiredVersion)
587 yield "requiredVersion=" + requiredVersion; 587 yield "requiredVersion=" + requiredVersion;
588 if (downloadCount) 588 if (downloadCount)
589 yield "downloadCount=" + downloadCount; 589 yield "downloadCount=" + downloadCount;
590 } 590 }
591 }); 591 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld