镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Commit f6e07fd

Browse files
cjihrigBethGriggs
authored andcommitted
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 <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent ee05411 commit f6e07fd

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎lib/net.js‎

Lines changed: 2 additions & 5 deletions
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)