diff options
Diffstat (limited to 'lib/url.js')
-rw-r--r-- | lib/url.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/url.js b/lib/url.js index 0e02dbc131..78dcbe7130 100644 --- a/lib/url.js +++ b/lib/url.js @@ -345,14 +345,14 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) { // pull out port. this.parseHost(); - // we've indicated that there is a hostname, + // We've indicated that there is a hostname, // so even if it's empty, it has to be present. if (typeof this.hostname !== 'string') this.hostname = ''; var hostname = this.hostname; - // if hostname begins with [ and ends with ] + // If hostname begins with [ and ends with ] // assume that it's an IPv6 address. var ipv6Hostname = hostname.charCodeAt(0) === CHAR_LEFT_SQUARE_BRACKET && hostname.charCodeAt(hostname.length - 1) === CHAR_RIGHT_SQUARE_BRACKET; @@ -527,9 +527,9 @@ function autoEscapeStr(rest) { return escaped; } -// format a parsed object into a url string +// Format a parsed object into a url string function urlFormat(urlObject, options) { - // ensure it's an object, and not a string url. + // Ensure it's an object, and not a string url. // If it's an object, this is a no-op. // this way, you can call urlParse() on strings // to clean up potentially wonky urls. @@ -678,7 +678,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { result[tkey] = this[tkey]; } - // hash is always overridden, no matter what. + // Hash is always overridden, no matter what. // even href="" will remove it. result.hash = relative.hash; @@ -688,9 +688,9 @@ Url.prototype.resolveObject = function resolveObject(relative) { return result; } - // hrefs like //foo/bar always cut to the protocol. + // Hrefs like //foo/bar always cut to the protocol. if (relative.slashes && !relative.protocol) { - // take everything except the protocol from relative + // Take everything except the protocol from relative var rkeys = Object.keys(relative); for (var rk = 0; rk < rkeys.length; rk++) { var rkey = rkeys[rk]; @@ -709,7 +709,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { } if (relative.protocol && relative.protocol !== result.protocol) { - // if it's a known url protocol, then changing + // If it's a known url protocol, then changing // the protocol does weird things // first, if it's not file:, then we MUST have a host, // and if there was a path @@ -770,7 +770,7 @@ Url.prototype.resolveObject = function resolveObject(relative) { var noLeadingSlashes = result.protocol && !slashedProtocol.has(result.protocol); - // if the url is a non-slashed url, then relative + // If the url is a non-slashed url, then relative // links like ../.. should be able // to crawl up to the hostname, as well. This is strange. // result.protocol has already been set by now. |