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

Unified Diff: test/matcher.js

Issue 29375915: Issue 4878 - Start using ESLint for adblockpluscore (Closed)
Patch Set: Removed unused imports Created March 15, 2017, 3:11 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 | « test/filterStorage_readwrite.js ('k') | test/notification.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/matcher.js
diff --git a/test/matcher.js b/test/matcher.js
index 47a469bb445cfa9594f0e96a2f547e253b94156c..2e00b4319be1dae6eff758a10186d7a63f6e4f41 100644
--- a/test/matcher.js
+++ b/test/matcher.js
@@ -17,7 +17,7 @@
"use strict";
-let {createSandbox} = require("./_common");
+const {createSandbox} = require("./_common");
let Filter = null;
let RegExpFilter = null;
@@ -42,13 +42,13 @@ function compareKeywords(test, text, expected)
{
let matcher = new Matcher();
let result = [];
- for (let dummy of expected)
+ for (let i = 0; i < expected.length; i++)
{
let keyword = matcher.findKeyword(filter);
result.push(keyword);
if (keyword)
{
- let dummyFilter = Filter.fromText('^' + keyword + '^');
+ let dummyFilter = Filter.fromText("^" + keyword + "^");
dummyFilter.filterCount = Infinity;
matcher.add(dummyFilter);
}
@@ -76,7 +76,7 @@ function checkMatch(test, filters, location, contentType, docDomain, thirdParty,
for (let filter of filters)
combinedMatcher.add(Filter.fromText(filter));
- let result = combinedMatcher.matchesAny(location, RegExpFilter.typeMap[contentType], docDomain, thirdParty, sitekey, specificOnly);
+ result = combinedMatcher.matchesAny(location, RegExpFilter.typeMap[contentType], docDomain, thirdParty, sitekey, specificOnly);
if (result)
result = result.text;
@@ -88,7 +88,7 @@ function checkMatch(test, filters, location, contentType, docDomain, thirdParty,
continue;
// For next run: add whitelisting filters for filters that aren't already
- filters = filters.map((text) => text.substr(0, 2) == "@@" ? text : "@@" + text);
+ filters = filters.map(text => text.substr(0, 2) == "@@" ? text : "@@" + text);
if (expected && expected.substr(0, 2) != "@@")
expected = "@@" + expected;
}
« no previous file with comments | « test/filterStorage_readwrite.js ('k') | test/notification.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld