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

Unified Diff: lib/filterListener.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/filterClasses.js ('k') | lib/filterNotifier.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterListener.js
===================================================================
--- a/lib/filterListener.js
+++ b/lib/filterListener.js
@@ -50,17 +50,17 @@
* FilterStorage.saveToDisk() if it becomes 1 or more. Save is
* executed delayed to prevent multiple subsequent calls. If the
* parameter is 0 it forces saving filters if any changes were
* recorded after the previous save.
* @param {number} factor
*/
setDirty(factor)
{
- if (factor == 0 && isDirty > 0)
+ if (factor === 0 && isDirty > 0)
isDirty = 1;
else
isDirty += factor;
if (isDirty >= 1)
{
isDirty = 0;
FilterStorage.saveToDisk();
}
@@ -69,17 +69,17 @@
/**
* Observer listening to history purge actions.
* @class
*/
let HistoryPurgeObserver = {
observe(subject, topic, data)
{
- if (topic == "browser:purge-session-history" &&
+ if (topic === "browser:purge-session-history" &&
Prefs.clearStatsOnHistoryPurge)
{
FilterStorage.resetHitCounts();
FilterListener.setDirty(0); // Force saving to disk
Prefs.recentReports = [];
}
},
@@ -210,17 +210,17 @@
if (!len)
return;
let current = (Math.random() * len) | 0;
let step;
do
{
step = primes[(Math.random() * primes.length) | 0];
- } while (len % step == 0);
+ } while (len % step === 0);
for (let i = 0; i < len; i++, current = (current + step) % len)
addFilter(filters[current]);
}
function onSubscriptionAdded(subscription)
{
FilterListener.setDirty(1);
@@ -238,17 +238,17 @@
}
function onSubscriptionDisabled(subscription, newValue)
{
FilterListener.setDirty(1);
if (FilterStorage.knownSubscriptions.has(subscription.url))
{
- if (newValue == false)
+ if (newValue === false)
addFilters(subscription.filters);
else
subscription.filters.forEach(removeFilter);
}
}
function onSubscriptionUpdated(subscription)
{
@@ -259,17 +259,17 @@
{
subscription.oldFilters.forEach(removeFilter);
addFilters(subscription.filters);
}
}
function onFilterHitCount(filter, newValue)
{
- if (newValue == 0)
+ if (newValue === 0)
FilterListener.setDirty(0);
else
FilterListener.setDirty(0.002);
}
function onFilterLastHit()
{
FilterListener.setDirty(0.002);
@@ -290,17 +290,17 @@
if (!filter.disabled)
removeFilter(filter);
}
function onFilterDisabled(filter, newValue)
{
FilterListener.setDirty(1);
- if (newValue == false)
+ if (newValue === false)
addFilter(filter);
else
removeFilter(filter);
}
function onGenericChange()
{
FilterListener.setDirty(1);
« no previous file with comments | « lib/filterClasses.js ('k') | lib/filterNotifier.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld