From 1458c26a1a413857f785340d38ab36ade15c644a Mon Sep 17 00:00:00 2001 From: Philipp Dunkel Date: Tue, 6 Nov 2018 15:25:35 +0000 Subject: [PATCH] net: remove unreachable check in internalConnect Checked all call-sites to ensure that this code is truly unreachable. addressType is always checked before internalConnect is even called. --- lib/net.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/net.js b/lib/net.js index 05fc4fa9598b04..be393538cdcc7c 100644 --- a/lib/net.js +++ b/lib/net.js @@ -842,9 +842,6 @@ function internalConnect( } else if (addressType === 6) { localAddress = localAddress || '::'; err = self._handle.bind6(localAddress, localPort); - } else { - self.destroy(new ERR_INVALID_ADDRESS_FAMILY(addressType)); - return; } debug('binding to localAddress: %s and localPort: %d (addressType: %d)', localAddress, localPort, addressType);