Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d07bd79

Browse filesBrowse files
anonrigaduh95
authored andcommitted
net: replace brand checks with identity checks
PR-URL: #57341 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 99b2369 commit d07bd79
Copy full SHA for d07bd79

File tree

Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎lib/net.js‎

Copy file name to clipboardExpand all lines: lib/net.js
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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
}
13211321

1322-
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
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.