http: delay ret declaration in method _flushOutput · nodejs/node@c96946d (original) (raw)

Original file line number Diff line number Diff line change
@@ -791,13 +791,13 @@ OutgoingMessage.prototype._flush = function _flush() {
791 791 };
792 792
793 793 OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
794 -var ret;
795 -var outputLength = this.outputData.length;
794 +const outputLength = this.outputData.length;
796 795 if (outputLength <= 0)
797 -return ret;
796 +return undefined;
798 797
799 -var outputData = this.outputData;
798 +const outputData = this.outputData;
800 799 socket.cork();
800 +let ret;
801 801 for (var i = 0; i < outputLength; i++) {
802 802 const { data, encoding, callback } = outputData[i];
803 803 ret = socket.write(data, encoding, callback);