Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 9209efa

Browse files
committedFeb 24, 2017
net: prefer === to ==
* Change === to == in one place * Add explanation about another non-strict if-statement
1 parent 4f638f6 commit 9209efa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎lib/net.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ function Socket(options) {
146146
} else if (options.fd !== undefined) {
147147
this._handle = createHandle(options.fd);
148148
this._handle.open(options.fd);
149+
// options.fd can be string (since it user-defined),
150+
// so changing this to === would be semver-major
151+
// See: https://github.com/nodejs/node/pull/11513
149152
if ((options.fd == 1 || options.fd == 2) &&
150153
(this._handle instanceof Pipe) &&
151154
process.platform === 'win32') {
@@ -1069,7 +1072,7 @@ function afterConnect(status, handle, req, readable, writable) {
10691072
self.connecting = false;
10701073
self._sockname = null;
10711074

1072-
if (status == 0) {
1075+
if (status === 0) {
10731076
self.readable = readable;
10741077
self.writable = writable;
10751078
self._unrefTimer();

0 commit comments

Comments
 (0)
Please sign in to comment.