Skip to content

Commit 06134e3

Browse files
committed
net: use strict comparisons for fd
This commit removes an eslint-disable comment, and moves file descriptor checks to use strict equality. These checks were using loose equality to support numeric and string file descriptors. However, d9e95d8 introduced strict validation, making the loose equality checks redundant. PR-URL: #25014 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]> Reviewed-By: Daijiro Wachi <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0fdd23f commit 06134e3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/net.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,11 +281,8 @@ function Socket(options) {
281281
throw errnoException(err, 'open');
282282

283283
this[async_id_symbol] = this._handle.getAsyncId();
284-
// options.fd can be string (since it is user-defined),
285-
// so changing this to === would be semver-major
286-
// See: https://github.com/nodejs/node/pull/11513
287-
// eslint-disable-next-line eqeqeq
288-
if ((fd == 1 || fd == 2) &&
284+
285+
if ((fd === 1 || fd === 2) &&
289286
(this._handle instanceof Pipe) &&
290287
process.platform === 'win32') {
291288
// Make stdout and stderr blocking on Windows

0 commit comments

Comments
 (0)