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

Unified Diff: lib/filterClasses.js

Issue 29892582: Noissue - Use Array.prototype.includes in isActiveOnDomain (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created Sept. 26, 2018, 9:06 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/filterClasses.js
===================================================================
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -527,17 +527,17 @@
* @return {boolean} true in case of the filter being active
*/
isActiveOnDomain(docDomain, sitekey)
{
// Sitekeys are case-sensitive so we shouldn't convert them to
// upper-case to avoid false positives here. Instead we need to
// change the way filter options are parsed.
if (this.sitekeys &&
- (!sitekey || this.sitekeys.indexOf(sitekey.toUpperCase()) < 0))
+ (!sitekey || !this.sitekeys.includes(sitekey.toUpperCase())))
{
return false;
}
let {domains} = this;
// If no domains are set the rule matches everywhere
if (!domains)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld