url: name anonymous functions in url
Name anonymous functions in url.js. PR-URL: https://github.com/nodejs/node/pull/9225 Ref: https://github.com/nodejs/node/issues/8913 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
This commit is contained in:
parent
9ac363b5d6
commit
c1dee6ac97
10
lib/url.js
10
lib/url.js
@ -97,7 +97,7 @@ function urlParse(url, parseQueryString, slashesDenoteHost) {
|
|||||||
return u;
|
return u;
|
||||||
}
|
}
|
||||||
|
|
||||||
Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
|
Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
|
||||||
if (typeof url !== 'string') {
|
if (typeof url !== 'string') {
|
||||||
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
|
throw new TypeError('Parameter "url" must be a string, not ' + typeof url);
|
||||||
}
|
}
|
||||||
@ -567,7 +567,7 @@ function urlFormat(obj, options) {
|
|||||||
return obj.format();
|
return obj.format();
|
||||||
}
|
}
|
||||||
|
|
||||||
Url.prototype.format = function() {
|
Url.prototype.format = function format() {
|
||||||
var auth = this.auth || '';
|
var auth = this.auth || '';
|
||||||
if (auth) {
|
if (auth) {
|
||||||
auth = encodeAuth(auth);
|
auth = encodeAuth(auth);
|
||||||
@ -652,7 +652,7 @@ function urlResolve(source, relative) {
|
|||||||
return urlParse(source, false, true).resolve(relative);
|
return urlParse(source, false, true).resolve(relative);
|
||||||
}
|
}
|
||||||
|
|
||||||
Url.prototype.resolve = function(relative) {
|
Url.prototype.resolve = function resolve(relative) {
|
||||||
return this.resolveObject(urlParse(relative, false, true)).format();
|
return this.resolveObject(urlParse(relative, false, true)).format();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -661,7 +661,7 @@ function urlResolveObject(source, relative) {
|
|||||||
return urlParse(source, false, true).resolveObject(relative);
|
return urlParse(source, false, true).resolveObject(relative);
|
||||||
}
|
}
|
||||||
|
|
||||||
Url.prototype.resolveObject = function(relative) {
|
Url.prototype.resolveObject = function resolveObject(relative) {
|
||||||
if (typeof relative === 'string') {
|
if (typeof relative === 'string') {
|
||||||
var rel = new Url();
|
var rel = new Url();
|
||||||
rel.parse(relative, false, true);
|
rel.parse(relative, false, true);
|
||||||
@ -939,7 +939,7 @@ Url.prototype.resolveObject = function(relative) {
|
|||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
Url.prototype.parseHost = function() {
|
Url.prototype.parseHost = function parseHost() {
|
||||||
var host = this.host;
|
var host = this.host;
|
||||||
var port = portPattern.exec(host);
|
var port = portPattern.exec(host);
|
||||||
if (port) {
|
if (port) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user