Skip to content

Commit

Permalink
net: remove an unused internal module assertPort
Browse files Browse the repository at this point in the history
A module `assertPort` in `lib/internal/net.js` is not used anymore.

Refs: nodejs#11667
PR-URL: nodejs#11812
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
watilde committed May 5, 2017
1 parent 69a8053 commit acb77f3
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/internal/net.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use strict';

module.exports = { isLegalPort, assertPort };

// Check that the port number is not NaN when coerced to a number,
// is an integer and that it falls within the legal range of port numbers.
function isLegalPort(port) {
Expand All @@ -11,8 +9,6 @@ function isLegalPort(port) {
return +port === (+port >>> 0) && port <= 0xFFFF;
}


function assertPort(port) {
if (typeof port !== 'undefined' && !isLegalPort(port))
throw new RangeError('"port" argument must be >= 0 and < 65536');
}
module.exports = {
isLegalPort
};

0 comments on commit acb77f3

Please sign in to comment.