lib: fix unnecessary coercion in lib/net.js
authorThom Seddon <thom@nightworld.com>
Tue, 28 Jan 2014 16:18:36 +0000 (16:18 +0000)
committerFedor Indutny <fedor.indutny@gmail.com>
Tue, 28 Jan 2014 23:08:06 +0000 (03:08 +0400)
Original patch by @skypjack in #6627

lib/net.js

index 8e6dcbf..3d0fe69 100644 (file)
@@ -784,7 +784,7 @@ function connect(self, address, port, addressType, localAddress) {
 
   var err;
   if (localAddress) {
-    if (addressType == 6) {
+    if (addressType === 6) {
       err = self._handle.bind6(localAddress);
     } else {
       err = self._handle.bind(localAddress);
@@ -1020,7 +1020,7 @@ var createServerHandle = exports._createServerHandle =
     handle.writable = true;
     return handle;
 
-  } else if (port == -1 && addressType == -1) {
+  } else if (port === -1 && addressType === -1) {
     handle = createPipe();
     if (process.platform === 'win32') {
       var instances = parseInt(process.env.NODE_PENDING_PIPE_INSTANCES);
@@ -1034,7 +1034,7 @@ var createServerHandle = exports._createServerHandle =
 
   if (address || port) {
     debug('bind to ' + address);
-    if (addressType == 6) {
+    if (addressType === 6) {
       err = handle.bind6(address, port);
     } else {
       err = handle.bind(address, port);