Skip to content

Commit 742ec62

Browse files
notarseniyMylesBorins
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 8287d03 commit 742ec62

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/net.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,9 @@ function Socket(options) {
143143
} else if (options.fd !== undefined) {
144144
this._handle = createHandle(options.fd);
145145
this._handle.open(options.fd);
146+
// options.fd can be string (since it user-defined),
147+
// so changing this to === would be semver-major
148+
// See: https://github.com/nodejs/node/pull/11513
146149
if ((options.fd == 1 || options.fd == 2) &&
147150
(this._handle instanceof Pipe) &&
148151
process.platform === 'win32') {
@@ -1066,7 +1069,7 @@ function afterConnect(status, handle, req, readable, writable) {
10661069
self.connecting = false;
10671070
self._sockname = null;
10681071

1069-
if (status == 0) {
1072+
if (status === 0) {
10701073
self.readable = readable;
10711074
self.writable = writable;
10721075
self._unrefTimer();

0 commit comments

Comments
 (0)