summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorWeijia Wang <381152119@qq.com>2018-03-25 22:27:38 +0800
committerWeijia Wang <381152119@qq.com>2018-04-01 22:33:13 +0800
commit254058109f469f64b8ca23bb65a206abab380604 (patch)
tree4069f77207f62816c248ed1ac9910467ff1b15d6 /lib/url.js
parentf89f79893d6e15938f9237efe4d2473ab4a65e9f (diff)
downloadandroid-node-v8-254058109f469f64b8ca23bb65a206abab380604.tar.gz
android-node-v8-254058109f469f64b8ca23bb65a206abab380604.tar.bz2
android-node-v8-254058109f469f64b8ca23bb65a206abab380604.zip
tools: add 'spaced-comment' into eslint rules
PR-URL: https://github.com/nodejs/node/pull/19596 Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js56
1 files changed, 28 insertions, 28 deletions
diff --git a/lib/url.js b/lib/url.js
index 78c0ea3d17..ac9879a650 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -482,19 +482,19 @@ function validateHostname(self, rest, hostname) {
// Escaped characters. Use empty strings to fill up unused entries.
// Using Array is faster than Object/Map
const escapedCodes = [
- /*0 - 9*/ '', '', '', '', '', '', '', '', '', '%09',
- /*10 - 19*/ '%0A', '', '', '%0D', '', '', '', '', '', '',
- /*20 - 29*/ '', '', '', '', '', '', '', '', '', '',
- /*30 - 39*/ '', '', '%20', '', '%22', '', '', '', '', '%27',
- /*40 - 49*/ '', '', '', '', '', '', '', '', '', '',
- /*50 - 59*/ '', '', '', '', '', '', '', '', '', '',
- /*60 - 69*/ '%3C', '', '%3E', '', '', '', '', '', '', '',
- /*70 - 79*/ '', '', '', '', '', '', '', '', '', '',
- /*80 - 89*/ '', '', '', '', '', '', '', '', '', '',
- /*90 - 99*/ '', '', '%5C', '', '%5E', '', '%60', '', '', '',
- /*100 - 109*/ '', '', '', '', '', '', '', '', '', '',
- /*110 - 119*/ '', '', '', '', '', '', '', '', '', '',
- /*120 - 125*/ '', '', '', '%7B', '%7C', '%7D'
+ /* 0 - 9 */ '', '', '', '', '', '', '', '', '', '%09',
+ /* 10 - 19 */ '%0A', '', '', '%0D', '', '', '', '', '', '',
+ /* 20 - 29 */ '', '', '', '', '', '', '', '', '', '',
+ /* 30 - 39 */ '', '', '%20', '', '%22', '', '', '', '', '%27',
+ /* 40 - 49 */ '', '', '', '', '', '', '', '', '', '',
+ /* 50 - 59 */ '', '', '', '', '', '', '', '', '', '',
+ /* 60 - 69 */ '%3C', '', '%3E', '', '', '', '', '', '', '',
+ /* 70 - 79 */ '', '', '', '', '', '', '', '', '', '',
+ /* 80 - 89 */ '', '', '', '', '', '', '', '', '', '',
+ /* 90 - 99 */ '', '', '%5C', '', '%5E', '', '%60', '', '', '',
+ /* 100 - 109 */ '', '', '', '', '', '', '', '', '', '',
+ /* 110 - 119 */ '', '', '', '', '', '', '', '', '', '',
+ /* 120 - 125 */ '', '', '', '%7B', '%7C', '%7D'
];
// Automatically escape all delimiters and unwise characters from RFC 2396.
@@ -592,7 +592,7 @@ Url.prototype.format = function format() {
var search = this.search || (query && ('?' + query)) || '';
- if (protocol && protocol.charCodeAt(protocol.length - 1) !== 58/*:*/)
+ if (protocol && protocol.charCodeAt(protocol.length - 1) !== 58/* : */)
protocol += ':';
var newPathname = '';
@@ -628,10 +628,10 @@ Url.prototype.format = function format() {
pathname = '/' + pathname;
host = '//' + host;
} else if (protocol.length >= 4 &&
- protocol.charCodeAt(0) === 102/*f*/ &&
- protocol.charCodeAt(1) === 105/*i*/ &&
- protocol.charCodeAt(2) === 108/*l*/ &&
- protocol.charCodeAt(3) === 101/*e*/) {
+ protocol.charCodeAt(0) === 102/* f */ &&
+ protocol.charCodeAt(1) === 105/* i */ &&
+ protocol.charCodeAt(2) === 108/* l */ &&
+ protocol.charCodeAt(3) === 101/* e */) {
host = '//';
}
}
@@ -693,7 +693,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
result[rkey] = relative[rkey];
}
- //urlParse appends trailing / to urls like http://www.example.com
+ // urlParse appends trailing / to urls like http://www.example.com
if (slashedProtocol[result.protocol] &&
result.hostname && !result.pathname) {
result.path = result.pathname = '/';
@@ -819,9 +819,9 @@ Url.prototype.resolveObject = function resolveObject(relative) {
// Put this after the other two cases because it simplifies the booleans
if (noLeadingSlashes) {
result.hostname = result.host = srcPath.shift();
- //occasionally the auth can get stuck only in host
- //this especially happens in cases like
- //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
+ // Occasionally the auth can get stuck only in host.
+ // This especially happens in cases like
+ // url.resolveObject('mailto:local1@domain1', 'local2@domain2')
const authInHost =
result.host && result.host.indexOf('@') > 0 && result.host.split('@');
if (authInHost) {
@@ -831,7 +831,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
}
result.search = relative.search;
result.query = relative.query;
- //to support http.request
+ // To support http.request
if (result.pathname !== null || result.search !== null) {
result.path = (result.pathname ? result.pathname : '') +
(result.search ? result.search : '');
@@ -844,7 +844,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
// no path at all. easy.
// we've already handled the other stuff above.
result.pathname = null;
- //to support http.request
+ // To support http.request
if (result.search) {
result.path = '/' + result.search;
} else {
@@ -901,9 +901,9 @@ Url.prototype.resolveObject = function resolveObject(relative) {
if (noLeadingSlashes) {
result.hostname =
result.host = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';
- //occasionally the auth can get stuck only in host
- //this especially happens in cases like
- //url.resolveObject('mailto:local1@domain1', 'local2@domain2')
+ // Occasionally the auth can get stuck only in host.
+ // This especially happens in cases like
+ // url.resolveObject('mailto:local1@domain1', 'local2@domain2')
const authInHost = result.host && result.host.indexOf('@') > 0 ?
result.host.split('@') : false;
if (authInHost) {
@@ -925,7 +925,7 @@ Url.prototype.resolveObject = function resolveObject(relative) {
result.pathname = srcPath.join('/');
}
- //to support request.http
+ // To support request.http
if (result.pathname !== null || result.search !== null) {
result.path = (result.pathname ? result.pathname : '') +
(result.search ? result.search : '');