lib: fix unnecessary coercion in lib/net.js
Original patch by @skypjack in #6627
This commit is contained in:
parent
8eaa1ac463
commit
657cd2c4e5
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user