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

Unified Diff: lib/subscriptionClasses.js

Issue 29807560: Issue 6745 - Prefer strict equality operator (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created June 14, 2018, 4:11 p.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/notification.js ('k') | lib/synchronizer.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
@@ -66,17 +66,17 @@
* @type {string}
*/
get title()
{
return this._title;
},
set title(value)
{
- if (value != this._title)
+ if (value !== this._title)
{
let oldValue = this._title;
this._title = value;
FilterNotifier.triggerListeners("subscription.title",
this, value, oldValue);
}
return this._title;
},
@@ -86,17 +86,17 @@
* @type {boolean}
*/
get fixedTitle()
{
return this._fixedTitle;
},
set fixedTitle(value)
{
- if (value != this._fixedTitle)
+ if (value !== this._fixedTitle)
{
let oldValue = this._fixedTitle;
this._fixedTitle = value;
FilterNotifier.triggerListeners("subscription.fixedTitle",
this, value, oldValue);
}
return this._fixedTitle;
},
@@ -106,17 +106,17 @@
* @type {boolean}
*/
get disabled()
{
return this._disabled;
},
set disabled(value)
{
- if (value != this._disabled)
+ if (value !== this._disabled)
{
let oldValue = this._disabled;
this._disabled = value;
FilterNotifier.triggerListeners("subscription.disabled",
this, value, oldValue);
}
return this._disabled;
},
@@ -166,33 +166,33 @@
* subscription or null if the subscription couldn't be created
*/
Subscription.fromURL = function(url)
{
let subscription = Subscription.knownSubscriptions.get(url);
if (subscription)
return subscription;
- if (url[0] != "~")
+ if (url[0] !== "~")
return new DownloadableSubscription(url, null);
return new SpecialSubscription(url);
};
/**
* Deserializes a subscription
*
* @param {Object} obj
* map of serialized properties and their values
* @return {Subscription}
* subscription or null if the subscription couldn't be created
*/
Subscription.fromObject = function(obj)
{
let result;
- if (obj.url[0] != "~")
+ if (obj.url[0] !== "~")
{
// URL is valid - this is a downloadable subscription
result = new DownloadableSubscription(obj.url, obj.title);
if ("downloadStatus" in obj)
result._downloadStatus = obj.downloadStatus;
if ("lastSuccess" in obj)
result.lastSuccess = parseInt(obj.lastSuccess, 10) || 0;
if ("lastCheck" in obj)
@@ -216,19 +216,19 @@
}
else
{
result = new SpecialSubscription(obj.url, obj.title);
if ("defaults" in obj)
result.defaults = obj.defaults.split(" ");
}
if ("fixedTitle" in obj)
- result._fixedTitle = (obj.fixedTitle == "true");
+ result._fixedTitle = (obj.fixedTitle === "true");
if ("disabled" in obj)
- result._disabled = (obj.disabled == "true");
+ result._disabled = (obj.disabled === "true");
return result;
};
/**
* Class for special filter subscriptions (user's filters)
* @param {string} url see {@link Subscription Subscription()}
* @param {string} [title] see {@link Subscription Subscription()}
@@ -257,17 +257,17 @@
isDefaultFor(filter)
{
if (this.defaults && this.defaults.length)
{
for (let type of this.defaults)
{
if (filter instanceof SpecialSubscription.defaultsMap.get(type))
return true;
- if (!(filter instanceof ActiveFilter) && type == "blacklist")
+ if (!(filter instanceof ActiveFilter) && type === "blacklist")
return true;
}
}
return false;
},
/**
@@ -354,17 +354,17 @@
* @type {string}
*/
get homepage()
{
return this._homepage;
},
set homepage(value)
{
- if (value != this._homepage)
+ if (value !== this._homepage)
{
let oldValue = this._homepage;
this._homepage = value;
FilterNotifier.triggerListeners("subscription.homepage",
this, value, oldValue);
}
return this._homepage;
},
@@ -375,17 +375,17 @@
* @type {number}
*/
get lastDownload()
{
return this._lastDownload;
},
set lastDownload(value)
{
- if (value != this._lastDownload)
+ if (value !== this._lastDownload)
{
let oldValue = this._lastDownload;
this._lastDownload = value;
FilterNotifier.triggerListeners("subscription.lastDownload",
this, value, oldValue);
}
return this._lastDownload;
},
@@ -479,17 +479,17 @@
* @type {number}
*/
get lastCheck()
{
return this._lastCheck;
},
set lastCheck(value)
{
- if (value != this._lastCheck)
+ if (value !== this._lastCheck)
{
let oldValue = this._lastCheck;
this._lastCheck = value;
FilterNotifier.triggerListeners("subscription.lastCheck",
this, value, oldValue);
}
return this._lastCheck;
},
@@ -513,17 +513,17 @@
* @type {number}
*/
get errors()
{
return this._errors;
},
set errors(value)
{
- if (value != this._errors)
+ if (value !== this._errors)
{
let oldValue = this._errors;
this._errors = value;
FilterNotifier.triggerListeners("subscription.errors", this,
value, oldValue);
}
return this._errors;
},
« no previous file with comments | « lib/notification.js ('k') | lib/synchronizer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld