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

Unified Diff: lib/filterClasses.js

Issue 29737555: Noissue - Check for null and blank string instead of undefined (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created March 30, 2018, 1:54 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
@@ -788,40 +788,40 @@
}
option = option.replace(/-/, "_").toUpperCase();
if (option in RegExpFilter.typeMap)
{
if (contentType == null)
contentType = 0;
contentType |= RegExpFilter.typeMap[option];
- if (option == "CSP" && typeof value != "undefined")
+ if (option == "CSP" && value)
csp = value;
}
else if (option[0] == "~" && option.substr(1) in RegExpFilter.typeMap)
{
if (contentType == null)
({contentType} = RegExpFilter.prototype);
contentType &= ~RegExpFilter.typeMap[option.substr(1)];
}
else if (option == "MATCH_CASE")
matchCase = true;
else if (option == "~MATCH_CASE")
matchCase = false;
- else if (option == "DOMAIN" && typeof value != "undefined")
+ else if (option == "DOMAIN" && value)
domains = value.toUpperCase();
else if (option == "THIRD_PARTY")
thirdParty = true;
else if (option == "~THIRD_PARTY")
thirdParty = false;
else if (option == "COLLAPSE")
collapse = true;
else if (option == "~COLLAPSE")
collapse = false;
- else if (option == "SITEKEY" && typeof value != "undefined")
+ else if (option == "SITEKEY" && value)
sitekeys = value.toUpperCase();
else
return new InvalidFilter(origText, "filter_unknown_option");
}
}
try
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld