summaryrefslogtreecommitdiff
path: root/lib/net.js
diff options
context:
space:
mode:
authorcjihrig <cjihrig@gmail.com>2018-12-13 09:11:13 -0500
committercjihrig <cjihrig@gmail.com>2018-12-15 12:16:42 -0500
commit06134e3598c1b3ae89d4be84466d532c249f5d9d (patch)
tree33b78dd29372b2eb30b74b0843cbbd4920f189fa /lib/net.js
parent0fdd23fa3fc794a64718e1b761b2ef5efa864ecd (diff)
downloadandroid-node-v8-06134e3598c1b3ae89d4be84466d532c249f5d9d.tar.gz
android-node-v8-06134e3598c1b3ae89d4be84466d532c249f5d9d.tar.bz2
android-node-v8-06134e3598c1b3ae89d4be84466d532c249f5d9d.zip
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, d9e95d8982ee5b409b36f09c77feccbb1040095c introduced strict validation, making the loose equality checks redundant. PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/net.js')
-rw-r--r--lib/net.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/net.js b/lib/net.js
index 7bbabc75ba..990fd7b5a1 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -281,11 +281,8 @@ function Socket(options) {
throw errnoException(err, 'open');
this[async_id_symbol] = this._handle.getAsyncId();
- // options.fd can be string (since it is user-defined),
- // so changing this to === would be semver-major
- // See: https://github.com/nodejs/node/pull/11513
- // eslint-disable-next-line eqeqeq
- if ((fd == 1 || fd == 2) &&
+
+ if ((fd === 1 || fd === 2) &&
(this._handle instanceof Pipe) &&
process.platform === 'win32') {
// Make stdout and stderr blocking on Windows