summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorRoman Reiss <me@silverwind.io>2019-05-08 20:45:10 +0200
committerRoman Reiss <me@silverwind.io>2019-05-10 16:58:49 +0200
commit55b80f9029fb7d6a8b4212a9eebabdae970f7e52 (patch)
treefa4dfecd46f9b3816c5063adc208fc085f40577c /lib/url.js
parent99b196d4ba3c8919c9f35b406265b40e858d145a (diff)
downloadandroid-node-v8-55b80f9029fb7d6a8b4212a9eebabdae970f7e52.tar.gz
android-node-v8-55b80f9029fb7d6a8b4212a9eebabdae970f7e52.tar.bz2
android-node-v8-55b80f9029fb7d6a8b4212a9eebabdae970f7e52.zip
tools: enable block-scoped-var eslint rule
PR-URL: https://github.com/nodejs/node/pull/27616 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/url.js b/lib/url.js
index be483ae2bc..665bd43614 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -267,9 +267,10 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
// user@server is *always* interpreted as a hostname, and url
// resolution will treat //foo/bar as host=foo,path=bar because that's
// how the browser resolves relative URLs.
+ let slashes;
if (slashesDenoteHost || proto || hostPattern.test(rest)) {
- var slashes = rest.charCodeAt(0) === CHAR_FORWARD_SLASH &&
- rest.charCodeAt(1) === CHAR_FORWARD_SLASH;
+ slashes = rest.charCodeAt(0) === CHAR_FORWARD_SLASH &&
+ rest.charCodeAt(1) === CHAR_FORWARD_SLASH;
if (slashes && !(proto && hostlessProtocol.has(lowerProto))) {
rest = rest.slice(2);
this.slashes = true;