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

Unified Diff: test/matcher.js

Issue 30011555: Issue 7303 - Deprecate the use of String.prototype.substr() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase Created Feb. 21, 2019, 2:48 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
« lib/url.js ('K') | « test/_common.js ('k') | test/signatures.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/matcher.js
===================================================================
--- a/test/matcher.js
+++ b/test/matcher.js
@@ -83,18 +83,18 @@
test.equal(result, expected, "combinedMatch(" + location + ", " + contentType + ", " + docDomain + ", " + (thirdParty ? "third-party" : "first-party") + ", " + (sitekey || "no-sitekey") + ", " + (specificOnly ? "specificOnly" : "not-specificOnly") + ") with:\n" + filters.join("\n"));
// Generic whitelisting rules can match for specificOnly searches, so we
// can't easily know which rule will match for these whitelisting tests
if (specificOnly)
continue;
// For next run: add whitelisting filters for filters that aren't already
- filters = filters.map(text => text.substr(0, 2) == "@@" ? text : "@@" + text);
- if (expected && expected.substr(0, 2) != "@@")
+ filters = filters.map(text => text.substring(0, 2) == "@@" ? text : "@@" + text);
+ if (expected && expected.substring(0, 2) != "@@")
expected = "@@" + expected;
}
}
function checkSearch(test, filters, location, contentType, docDomain,
thirdParty, sitekey, specificOnly, filterType,
expected)
{
« lib/url.js ('K') | « test/_common.js ('k') | test/signatures.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld