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

Unified Diff: lib/subscriptionClasses.js

Issue 6305806509146112: Issue 427 - Remove non-standard function and getter syntax (Closed)
Patch Set: Wow sorry for those wrong braces, I am so used to a different style that I didn't even realize what… Created May 18, 2014, 10:51 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/requestNotifier.js ('k') | lib/sync.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/subscriptionClasses.js
===================================================================
--- a/lib/subscriptionClasses.js
+++ b/lib/subscriptionClasses.js
@@ -63,49 +63,58 @@ Subscription.prototype =
_title: null,
_fixedTitle: false,
_disabled: false,
/**
* Title of the filter subscription
* @type String
*/
- get title() this._title,
+ get title()
+ {
+ return this._title;
+ },
set title(value)
{
if (value != this._title)
{
let oldValue = this._title;
this._title = value;
FilterNotifier.triggerListeners("subscription.title", this, value, oldValue);
}
return this._title;
},
/**
* Determines whether the title should be editable
* @type Boolean
*/
- get fixedTitle() this._fixedTitle,
+ get fixedTitle()
+ {
+ return this._fixedTitle;
+ },
set fixedTitle(value)
{
if (value != this._fixedTitle)
{
let oldValue = this._fixedTitle;
this._fixedTitle = value;
FilterNotifier.triggerListeners("subscription.fixedTitle", this, value, oldValue);
}
return this._fixedTitle;
},
/**
* Defines whether the filters in the subscription should be disabled
* @type Boolean
*/
- get disabled() this._disabled,
+ get disabled()
+ {
+ return this._disabled;
+ },
set disabled(value)
{
if (value != this._disabled)
{
let oldValue = this._disabled;
this._disabled = value;
FilterNotifier.triggerListeners("subscription.disabled", this, value, oldValue);
}
@@ -288,17 +297,17 @@ SpecialSubscription.prototype =
/**
* See Subscription.serialize()
*/
serialize: function(buffer)
{
Subscription.prototype.serialize.call(this, buffer);
if (this.defaults && this.defaults.length)
- buffer.push("defaults=" + this.defaults.filter(function(type) type in SpecialSubscription.defaultsMap).join(" "));
+ buffer.push("defaults=" + this.defaults.filter((type) => type in SpecialSubscription.defaultsMap).join(" "));
if (this._lastDownload)
buffer.push("lastDownload=" + this._lastDownload);
}
};
SpecialSubscription.defaultsMap = {
__proto__: null,
"whitelist": WhitelistFilter,
@@ -361,33 +370,39 @@ RegularSubscription.prototype =
_homepage: null,
_lastDownload: 0,
/**
* Filter subscription homepage if known
* @type String
*/
- get homepage() this._homepage,
+ get homepage()
+ {
+ return this._homepage;
+ },
set homepage(value)
{
if (value != this._homepage)
{
let oldValue = this._homepage;
this._homepage = value;
FilterNotifier.triggerListeners("subscription.homepage", this, value, oldValue);
}
return this._homepage;
},
/**
* Time of the last subscription download (in seconds since the beginning of the epoch)
* @type Number
*/
- get lastDownload() this._lastDownload,
+ get lastDownload()
+ {
+ return this._lastDownload;
+ },
set lastDownload(value)
{
if (value != this._lastDownload)
{
let oldValue = this._lastDownload;
this._lastDownload = value;
FilterNotifier.triggerListeners("subscription.lastDownload", this, value, oldValue);
}
@@ -453,17 +468,20 @@ DownloadableSubscription.prototype =
_downloadStatus: null,
_lastCheck: 0,
_errors: 0,
/**
* Status of the last download (ID of a string)
* @type String
*/
- get downloadStatus() this._downloadStatus,
+ get downloadStatus()
+ {
+ return this._downloadStatus;
+ },
set downloadStatus(value)
{
let oldValue = this._downloadStatus;
this._downloadStatus = value;
FilterNotifier.triggerListeners("subscription.downloadStatus", this, value, oldValue);
return this._downloadStatus;
},
@@ -474,17 +492,20 @@ DownloadableSubscription.prototype =
lastSuccess: 0,
/**
* Time when the subscription was considered for an update last time (in seconds
* since the beginning of the epoch). This will be used to increase softExpiration
* if the user doesn't use Adblock Plus for some time.
* @type Number
*/
- get lastCheck() this._lastCheck,
+ get lastCheck()
+ {
+ return this._lastCheck;
+ },
set lastCheck(value)
{
if (value != this._lastCheck)
{
let oldValue = this._lastCheck;
this._lastCheck = value;
FilterNotifier.triggerListeners("subscription.lastCheck", this, value, oldValue);
}
@@ -502,17 +523,20 @@ DownloadableSubscription.prototype =
* @type Number
*/
softExpiration: 0,
/**
* Number of download failures since last success
* @type Number
*/
- get errors() this._errors,
+ get errors()
+ {
+ return this._errors;
+ },
set errors(value)
{
if (value != this._errors)
{
let oldValue = this._errors;
this._errors = value;
FilterNotifier.triggerListeners("subscription.errors", this, value, oldValue);
}
« no previous file with comments | « lib/requestNotifier.js ('k') | lib/sync.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld