From 742ec6213fb855c92698d2ef8830fdd98544c108 Mon Sep 17 00:00:00 2001 From: Arseniy Maximov Date: Thu, 23 Feb 2017 02:46:32 +0300 Subject: [PATCH] net: prefer === to == * Change === to == in one place * Add explanation about another non-strict if-statement PR-URL: https://github.com/nodejs/node/pull/11513 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig --- lib/net.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 616c299b12c240..44b95073cf1445 100644 --- a/lib/net.js +++ b/lib/net.js @@ -143,6 +143,9 @@ function Socket(options) { } else if (options.fd !== undefined) { this._handle = createHandle(options.fd); this._handle.open(options.fd); + // options.fd can be string (since it user-defined), + // so changing this to === would be semver-major + // See: https://github.com/nodejs/node/pull/11513 if ((options.fd == 1 || options.fd == 2) && (this._handle instanceof Pipe) && process.platform === 'win32') { @@ -1066,7 +1069,7 @@ function afterConnect(status, handle, req, readable, writable) { self.connecting = false; self._sockname = null; - if (status == 0) { + if (status === 0) { self.readable = readable; self.writable = writable; self._unrefTimer();