Skip to content

Commit

Permalink
net: prefer === to ==
Browse files Browse the repository at this point in the history
* Change === to == in one place
* Add explanation about another non-strict if-statement

PR-URL: #11513
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
notarseniy authored and jasnell committed Mar 7, 2017
1 parent 71ae03b commit 7d0f808
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,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 @@ -1057,7 +1060,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

0 comments on commit 7d0f808

Please sign in to comment.