Skip to content

Commit c96946d

Browse files
gengjiawentargos
authored andcommitted
http: delay ret declaration in method _flushOutput
PR-URL: #26562 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 24e96b2 commit c96946d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/_http_outgoing.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -791,13 +791,13 @@ OutgoingMessage.prototype._flush = function _flush() {
791791
};
792792

793793
OutgoingMessage.prototype._flushOutput = function _flushOutput(socket) {
794-
var ret;
795-
var outputLength = this.outputData.length;
794+
const outputLength = this.outputData.length;
796795
if (outputLength <= 0)
797-
return ret;
796+
return undefined;
798797

799-
var outputData = this.outputData;
798+
const outputData = this.outputData;
800799
socket.cork();
800+
let ret;
801801
for (var i = 0; i < outputLength; i++) {
802802
const { data, encoding, callback } = outputData[i];
803803
ret = socket.write(data, encoding, callback);

0 commit comments

Comments
 (0)