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

Unified Diff: lib/notificationHelper.js

Issue 29522601: Noissue - Use includes instead of indexOf (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Aug. 21, 2017, 11:16 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/filterComposer.js ('k') | options.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/notificationHelper.js
===================================================================
--- a/lib/notificationHelper.js
+++ b/lib/notificationHelper.js
@@ -82,17 +82,17 @@
{
buttons = [
{
type: "open-all",
title: ext.i18n.getMessage("notification_open_all")
}
];
}
- if (["critical", "relentless"].indexOf(notificationType) == -1)
+ if (!["critical", "relentless"].includes(notificationType))
{
buttons.push({
type: "configure",
title: ext.i18n.getMessage("notification_configure")
});
}
}
@@ -265,17 +265,17 @@
*
* @param {string} method Display method: icon, notification or popup
* @param {string} notificationType
* @return {boolean}
*/
exports.shouldDisplay = (method, notificationType) =>
{
let methods = displayMethods[notificationType] || defaultDisplayMethods;
- return methods.indexOf(method) > -1;
+ return methods.includes(method);
};
ext.pages.onLoading.addListener(page =>
{
NotificationStorage.showNext(stringifyURL(page.url));
});
NotificationStorage.addShowListener(showNotification);
« no previous file with comments | « lib/filterComposer.js ('k') | options.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld