@@ -364,8 +364,7 @@ function writeHead(statusCode, reason, obj) {
364364 this . statusMessage = reason ;
365365 } else {
366366 // writeHead(statusCode[, headers])
367- if ( ! this . statusMessage )
368- this . statusMessage = STATUS_CODES [ statusCode ] || 'unknown' ;
367+ this . statusMessage ||= STATUS_CODES [ statusCode ] || 'unknown' ;
369368 obj ??= reason ;
370369 }
371370 this . statusCode = statusCode ;
@@ -517,9 +516,7 @@ function storeHTTPOptions(options) {
517516
518517function setupConnectionsTracking ( ) {
519518 // Start connection handling
520- if ( ! this [ kConnections ] ) {
521- this [ kConnections ] = new ConnectionsList ( ) ;
522- }
519+ this [ kConnections ] ||= new ConnectionsList ( ) ;
523520
524521 if ( this [ kConnectionsCheckingInterval ] ) {
525522 clearInterval ( this [ kConnectionsCheckingInterval ] ) ;
@@ -930,8 +927,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
930927 const req = parser . incoming ;
931928 debug ( 'SERVER upgrade or connect' , req . method ) ;
932929
933- if ( ! d )
934- d = parser . getCurrentBuffer ( ) ;
930+ d ||= parser . getCurrentBuffer ( ) ;
935931
936932 socket . removeListener ( 'data' , state . onData ) ;
937933 socket . removeListener ( 'end' , state . onEnd ) ;
@@ -969,7 +965,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
969965}
970966
971967function clearIncoming ( req ) {
972- req = req || this ;
968+ req ||= this ;
973969 const parser = req . socket ?. parser ;
974970 // Reset the .incoming property so that the request object can be gc'ed.
975971 if ( parser && parser . incoming === req ) {
0 commit comments