From 55b80f9029fb7d6a8b4212a9eebabdae970f7e52 Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Wed, 8 May 2019 20:45:10 +0200 Subject: tools: enable block-scoped-var eslint rule PR-URL: https://github.com/nodejs/node/pull/27616 Reviewed-By: Rich Trott Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/url.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/url.js') 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; -- cgit v1.2.3