Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function Socket(options) {
'is not supported',
);
}
if (typeof options?.keepAliveInitialDelay !== 'undefined') {
if (options?.keepAliveInitialDelay !== undefined) {
validateNumber(
options?.keepAliveInitialDelay, 'options.keepAliveInitialDelay',
);
Expand Down Expand Up @@ -1319,7 +1319,7 @@ function lookupAndConnect(self, options) {
validateNumber(localPort, 'options.localPort');
}

if (typeof port !== 'undefined') {
if (port !== undefined) {
if (typeof port !== 'number' && typeof port !== 'string') {
throw new ERR_INVALID_ARG_TYPE('options.port',
['number', 'string'], port);
Expand Down Expand Up @@ -1776,7 +1776,7 @@ function Server(options, connectionListener) {
} else {
throw new ERR_INVALID_ARG_TYPE('options', 'Object', options);
}
if (typeof options.keepAliveInitialDelay !== 'undefined') {
if (options.keepAliveInitialDelay !== undefined) {
validateNumber(
options.keepAliveInitialDelay, 'options.keepAliveInitialDelay',
);
Expand All @@ -1785,7 +1785,7 @@ function Server(options, connectionListener) {
options.keepAliveInitialDelay = 0;
}
}
if (typeof options.highWaterMark !== 'undefined') {
if (options.highWaterMark !== undefined) {
validateNumber(
options.highWaterMark, 'options.highWaterMark',
);
Expand Down Expand Up @@ -2076,7 +2076,7 @@ Server.prototype.listen = function(...args) {
// or (options[, cb]) where options.port is explicitly set as undefined or
// null, bind to an arbitrary unused port
if (args.length === 0 || typeof args[0] === 'function' ||
(typeof options.port === 'undefined' && 'port' in options) ||
(options.port === undefined && 'port' in options) ||
options.port === null) {
options.port = 0;
}
Expand Down
Loading