lib: make lowerProto scope more clear

PR-URL: https://github.com/nodejs/node/pull/26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
gengjiawen 2019-03-10 13:12:25 +08:00 committed by Daniel Bevenius
parent ccdaa434b8
commit 169b7f1f3b

View File

@ -249,10 +249,11 @@ Url.prototype.parse = function parse(url, parseQueryString, slashesDenoteHost) {
}
}
var proto = protocolPattern.exec(rest);
let proto = protocolPattern.exec(rest);
let lowerProto;
if (proto) {
proto = proto[0];
var lowerProto = proto.toLowerCase();
lowerProto = proto.toLowerCase();
this.protocol = lowerProto;
rest = rest.slice(proto.length);
}