Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
net: prefer === to ==
* Change === to == in one place
* Add explanation about another non-strict if-statement
  • Loading branch information
notarseniy committed Feb 24, 2017
commit 9209efa5f0891a4720ca4815862dd399fbae0a23
5 changes: 4 additions & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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();
Expand Down