◐ Shell
clean mode source ↗

net: replace brand checks with identity checks · nodejs/node@d07bd79

@@ -381,7 +381,7 @@ function Socket(options) {

381381

'is not supported',

382382

);

383383

}

384-

if (typeof options?.keepAliveInitialDelay !== 'undefined') {

384+

if (options?.keepAliveInitialDelay !== undefined) {

385385

validateNumber(

386386

options?.keepAliveInitialDelay, 'options.keepAliveInitialDelay',

387387

);

@@ -1319,7 +1319,7 @@ function lookupAndConnect(self, options) {

13191319

validateNumber(localPort, 'options.localPort');

13201320

}

132113211322-

if (typeof port !== 'undefined') {

1322+

if (port !== undefined) {

13231323

if (typeof port !== 'number' && typeof port !== 'string') {

13241324

throw new ERR_INVALID_ARG_TYPE('options.port',

13251325

['number', 'string'], port);

@@ -1776,7 +1776,7 @@ function Server(options, connectionListener) {

17761776

} else {

17771777

throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);

17781778

}

1779-

if (typeof options.keepAliveInitialDelay !== 'undefined') {

1779+

if (options.keepAliveInitialDelay !== undefined) {

17801780

validateNumber(

17811781

options.keepAliveInitialDelay, 'options.keepAliveInitialDelay',

17821782

);

@@ -1785,7 +1785,7 @@ function Server(options, connectionListener) {

17851785

options.keepAliveInitialDelay = 0;

17861786

}

17871787

}

1788-

if (typeof options.highWaterMark !== 'undefined') {

1788+

if (options.highWaterMark !== undefined) {

17891789

validateNumber(

17901790

options.highWaterMark, 'options.highWaterMark',

17911791

);

@@ -2076,7 +2076,7 @@ Server.prototype.listen = function(...args) {

20762076

// or (options[, cb]) where options.port is explicitly set as undefined or

20772077

// null, bind to an arbitrary unused port

20782078

if (args.length === 0 || typeof args[0] === 'function' ||

2079-

(typeof options.port === 'undefined' && 'port' in options) ||

2079+

(options.port === undefined && 'port' in options) ||

20802080

options.port === null) {

20812081

options.port = 0;

20822082

}