Skip to content

Commit cd722e2

Browse files
cjihrigrvagg
authored andcommittedFeb 28, 2019
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 ea548d5 commit cd722e2

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed
 

‎lib/net.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -275,11 +275,8 @@ function Socket(options) {
275275
throw errnoException(err, 'open');
276276

277277
this[async_id_symbol] = this._handle.getAsyncId();
278-
// options.fd can be string (since it is user-defined),
279-
// so changing this to === would be semver-major
280-
// See: https://github.com/nodejs/node/pull/11513
281-
// eslint-disable-next-line eqeqeq
282-
if ((fd == 1 || fd == 2) &&
278+
279+
if ((fd === 1 || fd === 2) &&
283280
(this._handle instanceof Pipe) &&
284281
process.platform === 'win32') {
285282
// Make stdout and stderr blocking on Windows

0 commit comments

Comments
 (0)
Please sign in to comment.