diff --git a/lib/net.js b/lib/net.js index 121309895343b7..0aa087ad7e7e9c 100644 --- a/lib/net.js +++ b/lib/net.js @@ -146,6 +146,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') { @@ -1069,7 +1072,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();