Index: chrome/content/tests/matcher.js |
=================================================================== |
--- a/chrome/content/tests/matcher.js |
+++ b/chrome/content/tests/matcher.js |
@@ -1,19 +1,19 @@ |
(function() |
{ |
module("Filter matcher", {setup: prepareFilterComponents, teardown: restoreFilterComponents}); |
function compareKeywords(text, expected) |
{ |
- for each (let filter in [Filter.fromText(text), Filter.fromText("@@" + text)]) |
+ for (let filter of [Filter.fromText(text), Filter.fromText("@@" + text)]) |
{ |
let matcher = new Matcher(); |
let result = []; |
- for each (let dummy in expected) |
+ for (let dummy of expected) |
{ |
keyword = matcher.findKeyword(filter); |
result.push(keyword); |
if (keyword) |
{ |
let dummyFilter = Filter.fromText('^' + keyword + '^'); |
dummyFilter.filterCount = Infinity; |
matcher.add(dummyFilter); |
@@ -22,29 +22,29 @@ |
equal(result.join(", "), expected.join(", "), "Keyword candidates for " + filter.text); |
} |
} |
function checkMatch(filters, location, contentType, docDomain, thirdParty, expected) |
{ |
let matcher = new Matcher(); |
- for each (let filter in filters) |
+ for (let filter of filters) |
matcher.add(Filter.fromText(filter)); |
let result = matcher.matchesAny(location, contentType, docDomain, thirdParty); |
if (result) |
result = result.text; |
equal(result, expected, "match(" + location + ", " + contentType + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ") with:\n" + filters.join("\n")); |
let combinedMatcher = new CombinedMatcher(); |
for (let i = 0; i < 2; i++) |
{ |
- for each (let filter in filters) |
+ for (let filter of filters) |
combinedMatcher.add(Filter.fromText(filter)); |
let result = combinedMatcher.matchesAny(location, contentType, docDomain, thirdParty); |
if (result) |
result = result.text; |
equal(result, expected, "combinedMatch(" + location + ", " + contentType + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ") with:\n" + filters.join("\n")); |