Skip to content

Commit

Permalink
http: use standard args order in IncomingMEssage onError
Browse files Browse the repository at this point in the history
PR-URL: #33035
Refs: #30625
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
dnlup authored and targos committed Dec 21, 2020
1 parent 60b5e69 commit 36b4ddd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/_http_incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
this.emit('aborted');
}

// If aborted and the underlying socket not already destroyed,
// If aborted and the underlying socket is not already destroyed,
// destroy it.
// We have to check if the socket is already destroyed because finished
// does not call the callback when this methdod is invoked from `_http_client`
Expand All @@ -178,10 +178,10 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
this.socket.destroy(err);
const cleanup = finished(this.socket, (e) => {
cleanup();
onError(this, cb, e || err);
onError(this, e || err, cb);
});
} else {
onError(this, cb, err);
onError(this, err, cb);
}
};

Expand Down Expand Up @@ -361,7 +361,7 @@ IncomingMessage.prototype._dump = function _dump() {
}
};

function onError(instance, cb, error) {
function onError(instance, error, cb) {
// This is to keep backward compatible behavior.
// An error is emitted only if there are listeners attached to
// the event.
Expand Down

0 comments on commit 36b4ddd

Please sign in to comment.