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

Unified Diff: test/_common.js

Issue 30011555: Issue 7303 - Deprecate the use of String.prototype.substr() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebase. Revert changes in hot path. Created Feb. 21, 2019, 6:09 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 | « lib/rsa.js ('k') | test/matcher.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/_common.js
===================================================================
--- a/test/_common.js
+++ b/test/_common.js
@@ -231,31 +231,31 @@
if (typeof async != "undefined" && !async)
throw new Error("Sync requests are not supported");
if (typeof user != "undefined" || typeof password != "undefined")
throw new Error("User authentification is not supported");
let match = /^data:[^,]+,/.exec(url);
if (match)
{
- this._data = decodeURIComponent(url.substr(match[0].length));
+ this._data = decodeURIComponent(url.substring(match[0].length));
return;
}
- if (url.substr(0, this._host.length + 1) != this._host + "/")
+ if (url.substring(0, this._host.length + 1) != this._host + "/")
throw new Error("Unexpected URL: " + url + " (URL starting with " + this._host + "expected)");
- this._path = url.substr(this._host.length);
+ this._path = url.substring(this._host.length);
let queryIndex = this._path.indexOf("?");
this._queryString = "";
if (queryIndex >= 0)
{
- this._queryString = this._path.substr(queryIndex + 1);
- this._path = this._path.substr(0, queryIndex);
+ this._queryString = this._path.substring(queryIndex + 1);
+ this._path = this._path.substring(0, queryIndex);
}
},
send(data)
{
if (!this._data && !this._path)
throw new Error("No request path set");
if (typeof data != "undefined" && data)
« no previous file with comments | « lib/rsa.js ('k') | test/matcher.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld