Skip to content

Commit

Permalink
lib: make lowerProto scope more clear
Browse files Browse the repository at this point in the history
PR-URL: #26562
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
gengjiawen authored and targos committed Mar 27, 2019
1 parent e8412bc commit 1c1305d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1c1305d

Please sign in to comment.