Skip to content

Commit 3afe90d

Browse files
notarseniyitaloacasas
authored andcommitted
net: prefer === to ==
* Change === to == in one place * Add explanation about another non-strict if-statement PR-URL: #11513 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 90bdf16 commit 3afe90d

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)