Skip to content

Commit a7df345

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 434b00b commit a7df345

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
@@ -137,6 +137,9 @@ function Socket(options) {
137137
} else if (options.fd !== undefined) {
138138
this._handle = createHandle(options.fd);
139139
this._handle.open(options.fd);
140+
// options.fd can be string (since it user-defined),
141+
// so changing this to === would be semver-major
142+
// See: https://github.com/nodejs/node/pull/11513
140143
if ((options.fd == 1 || options.fd == 2) &&
141144
(this._handle instanceof Pipe) &&
142145
process.platform === 'win32') {
@@ -1057,7 +1060,7 @@ function afterConnect(status, handle, req, readable, writable) {
10571060
self._connecting = false;
10581061
self._sockname = null;
10591062

1060-
if (status == 0) {
1063+
if (status === 0) {
10611064
self.readable = readable;
10621065
self.writable = writable;
10631066
self._unrefTimer();

0 commit comments

Comments
 (0)