diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 60ed6779c47979..ebc40d0961f105 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -792,13 +792,13 @@ OutgoingMessage.prototype._flush = function _flush() { }; OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) { - var ret; - var outputLength = this.outputData.length; + const outputLength = this.outputData.length; if (outputLength <= 0) - return ret; + return undefined; - var outputData = this.outputData; + const outputData = this.outputData; socket.cork(); + let ret; for (var i = 0; i < outputLength; i++) { const { data, encoding, callback } = outputData[i]; ret = socket.write(data, encoding, callback); diff --git a/lib/repl.js b/lib/repl.js index a641843d2c7fa3..f86ec72a8a0de3 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -1030,8 +1030,7 @@ function complete(line, callback) { // REPL commands (e.g. ".break"). var filter; - var match = null; - match = line.match(/^\s*\.(\w*)$/); + let match = line.match(/^\s*\.(\w*)$/); if (match) { completionGroups.push(Object.keys(this.commands)); completeOn = match[1]; diff --git a/lib/url.js b/lib/url.js index 391d6c2723d99d..b41000332a453b 100644 --- a/lib/url.js +++ b/lib/url.js @@ -250,10 +250,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); }