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

Delta Between Two Patch Sets: lib/subscriptionClasses.js

Issue 29375915: Issue 4878 - Start using ESLint for adblockpluscore (Closed)
Left Patch Set: Addressed Wladimir's comments Created March 8, 2017, 12:28 p.m.
Right Patch Set: Removed unused imports Created March 15, 2017, 3:11 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/rsa.js ('k') | lib/synchronizer.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-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 if (!(filter instanceof ActiveFilter) && type == "blacklist") 264 if (!(filter instanceof ActiveFilter) && type == "blacklist")
265 return true; 265 return true;
266 } 266 }
267 } 267 }
268 268
269 return false; 269 return false;
270 }, 270 },
271 271
272 /** 272 /**
273 * See Subscription.serialize() 273 * See Subscription.serialize()
274 * @inheritdoc
274 */ 275 */
275 serialize(buffer) 276 serialize(buffer)
276 { 277 {
277 Subscription.prototype.serialize.call(this, buffer); 278 Subscription.prototype.serialize.call(this, buffer);
278 if (this.defaults && this.defaults.length) 279 if (this.defaults && this.defaults.length)
279 { 280 {
280 buffer.push("defaults=" + 281 buffer.push("defaults=" +
281 this.defaults.filter( 282 this.defaults.filter(
282 type => type in SpecialSubscription.defaultsMap 283 type => type in SpecialSubscription.defaultsMap
283 ).join(" ") 284 ).join(" ")
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 let oldValue = this._lastDownload; 384 let oldValue = this._lastDownload;
384 this._lastDownload = value; 385 this._lastDownload = value;
385 FilterNotifier.triggerListeners("subscription.lastDownload", 386 FilterNotifier.triggerListeners("subscription.lastDownload",
386 this, value, oldValue); 387 this, value, oldValue);
387 } 388 }
388 return this._lastDownload; 389 return this._lastDownload;
389 }, 390 },
390 391
391 /** 392 /**
392 * See Subscription.serialize() 393 * See Subscription.serialize()
394 * @inheritdoc
393 */ 395 */
394 serialize(buffer) 396 serialize(buffer)
395 { 397 {
396 Subscription.prototype.serialize.call(this, buffer); 398 Subscription.prototype.serialize.call(this, buffer);
397 if (this._homepage) 399 if (this._homepage)
398 buffer.push("homepage=" + this._homepage); 400 buffer.push("homepage=" + this._homepage);
399 if (this._lastDownload) 401 if (this._lastDownload)
400 buffer.push("lastDownload=" + this._lastDownload); 402 buffer.push("lastDownload=" + this._lastDownload);
401 } 403 }
402 }); 404 });
403 405
404 /** 406 /**
405 * Class for filter subscriptions updated externally (by other extension) 407 * Class for filter subscriptions updated externally (by other extension)
406 * @param {string} url see Subscription() 408 * @param {string} url see Subscription()
407 * @param {string} [title] see Subscription() 409 * @param {string} [title] see Subscription()
408 * @constructor 410 * @constructor
409 * @augments RegularSubscription 411 * @augments RegularSubscription
410 */ 412 */
411 function ExternalSubscription(url, title) 413 function ExternalSubscription(url, title)
412 { 414 {
413 RegularSubscription.call(this, url, title); 415 RegularSubscription.call(this, url, title);
414 } 416 }
415 exports.ExternalSubscription = ExternalSubscription; 417 exports.ExternalSubscription = ExternalSubscription;
416 418
417 ExternalSubscription.prototype = extend(RegularSubscription, { 419 ExternalSubscription.prototype = extend(RegularSubscription, {
418 /** 420 /**
419 * See Subscription.serialize() 421 * See Subscription.serialize()
422 * @inheritdoc
420 */ 423 */
421 serialize(buffer) 424 serialize(buffer)
422 { 425 {
423 throw new Error( 426 throw new Error(
424 "Unexpected call, external subscriptions should not be serialized" 427 "Unexpected call, external subscriptions should not be serialized"
425 ); 428 );
426 } 429 }
427 }); 430 });
428 431
429 /** 432 /**
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 requiredVersion: null, 540 requiredVersion: null,
538 541
539 /** 542 /**
540 * Number indicating how often the object was downloaded. 543 * Number indicating how often the object was downloaded.
541 * @type {number} 544 * @type {number}
542 */ 545 */
543 downloadCount: 0, 546 downloadCount: 0,
544 547
545 /** 548 /**
546 * See Subscription.serialize() 549 * See Subscription.serialize()
550 * @inheritdoc
547 */ 551 */
548 serialize(buffer) 552 serialize(buffer)
549 { 553 {
550 RegularSubscription.prototype.serialize.call(this, buffer); 554 RegularSubscription.prototype.serialize.call(this, buffer);
551 if (this.downloadStatus) 555 if (this.downloadStatus)
552 buffer.push("downloadStatus=" + this.downloadStatus); 556 buffer.push("downloadStatus=" + this.downloadStatus);
553 if (this.lastSuccess) 557 if (this.lastSuccess)
554 buffer.push("lastSuccess=" + this.lastSuccess); 558 buffer.push("lastSuccess=" + this.lastSuccess);
555 if (this.lastCheck) 559 if (this.lastCheck)
556 buffer.push("lastCheck=" + this.lastCheck); 560 buffer.push("lastCheck=" + this.lastCheck);
557 if (this.expires) 561 if (this.expires)
558 buffer.push("expires=" + this.expires); 562 buffer.push("expires=" + this.expires);
559 if (this.softExpiration) 563 if (this.softExpiration)
560 buffer.push("softExpiration=" + this.softExpiration); 564 buffer.push("softExpiration=" + this.softExpiration);
561 if (this.errors) 565 if (this.errors)
562 buffer.push("errors=" + this.errors); 566 buffer.push("errors=" + this.errors);
563 if (this.version) 567 if (this.version)
564 buffer.push("version=" + this.version); 568 buffer.push("version=" + this.version);
565 if (this.requiredVersion) 569 if (this.requiredVersion)
566 buffer.push("requiredVersion=" + this.requiredVersion); 570 buffer.push("requiredVersion=" + this.requiredVersion);
567 if (this.downloadCount) 571 if (this.downloadCount)
568 buffer.push("downloadCount=" + this.downloadCount); 572 buffer.push("downloadCount=" + this.downloadCount);
569 } 573 }
570 }); 574 });
LEFTRIGHT

Powered by Google App Engine
This is Rietveld