@@ -169,7 +169,7 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
169169 this . emit ( 'aborted' ) ;
170170 }
171171
172- // If aborted and the underlying socket not already destroyed,
172+ // If aborted and the underlying socket is not already destroyed,
173173 // destroy it.
174174 // We have to check if the socket is already destroyed because finished
175175 // does not call the callback when this methdod is invoked from `_http_client`
@@ -178,10 +178,10 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
178178 this . socket . destroy ( err ) ;
179179 const cleanup = finished ( this . socket , ( e ) => {
180180 cleanup ( ) ;
181- onError ( this , cb , e || err ) ;
181+ onError ( this , e || err , cb ) ;
182182 } ) ;
183183 } else {
184- onError ( this , cb , err ) ;
184+ onError ( this , err , cb ) ;
185185 }
186186} ;
187187
@@ -361,7 +361,7 @@ IncomingMessage.prototype._dump = function _dump() {
361361 }
362362} ;
363363
364- function onError ( instance , cb , error ) {
364+ function onError ( instance , error , cb ) {
365365 // This is to keep backward compatible behavior.
366366 // An error is emitted only if there are listeners attached to
367367 // the event.
0 commit comments