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

Unified Diff: test/filterClasses.js

Issue 29791555: Issue 6727 - Use string rather than map for single-domain filters (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Created May 26, 2018, 10:52 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
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/filterClasses.js
===================================================================
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -66,20 +66,27 @@
{
result.push("disabled=" + filter.disabled);
result.push("lastHit=" + filter.lastHit);
result.push("hitCount=" + filter.hitCount);
let domains = [];
if (filter.domains)
{
- for (let [domain, isIncluded] of filter.domains)
+ if (typeof filter.domains == "string")
+ {
+ domains.push(filter.domains);
+ }
+ else
{
- if (domain != "")
- domains.push(isIncluded ? domain : "~" + domain);
+ for (let [domain, isIncluded] of filter.domains)
+ {
+ if (domain != "")
+ domains.push(isIncluded ? domain : "~" + domain);
+ }
}
}
result.push("domains=" + domains.sort().join("|"));
if (filter instanceof RegExpFilter)
{
result.push("regexp=" + filter.regexp.source);
result.push("contentType=" + filter.contentType);
« lib/filterClasses.js ('K') | « lib/filterClasses.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld