@@ -364,8 +364,7 @@ function writeHead(statusCode, reason, obj) {
364
364
this . statusMessage = reason ;
365
365
} else {
366
366
// writeHead(statusCode[, headers])
367
- if ( ! this . statusMessage )
368
- this . statusMessage = STATUS_CODES [ statusCode ] || 'unknown' ;
367
+ this . statusMessage ||= STATUS_CODES [ statusCode ] || 'unknown' ;
369
368
obj ??= reason ;
370
369
}
371
370
this . statusCode = statusCode ;
@@ -517,9 +516,7 @@ function storeHTTPOptions(options) {
517
516
518
517
function setupConnectionsTracking ( ) {
519
518
// Start connection handling
520
- if ( ! this [ kConnections ] ) {
521
- this [ kConnections ] = new ConnectionsList ( ) ;
522
- }
519
+ this [ kConnections ] ||= new ConnectionsList ( ) ;
523
520
524
521
if ( this [ kConnectionsCheckingInterval ] ) {
525
522
clearInterval ( this [ kConnectionsCheckingInterval ] ) ;
@@ -930,8 +927,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
930
927
const req = parser . incoming ;
931
928
debug ( 'SERVER upgrade or connect' , req . method ) ;
932
929
933
- if ( ! d )
934
- d = parser . getCurrentBuffer ( ) ;
930
+ d ||= parser . getCurrentBuffer ( ) ;
935
931
936
932
socket . removeListener ( 'data' , state . onData ) ;
937
933
socket . removeListener ( 'end' , state . onEnd ) ;
@@ -969,7 +965,7 @@ function onParserExecuteCommon(server, socket, parser, state, ret, d) {
969
965
}
970
966
971
967
function clearIncoming ( req ) {
972
- req = req || this ;
968
+ req ||= this ;
973
969
const parser = req . socket ?. parser ;
974
970
// Reset the .incoming property so that the request object can be gc'ed.
975
971
if ( parser && parser . incoming === req ) {
0 commit comments