From 33ea7a2984fc8a0ff1cdbb9268d9e470b360f4ce Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Tue, 14 Mar 2017 18:51:36 +0100 Subject: [PATCH] net: remove an unused internal module `assertPort` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A module `assertPort` in `lib/internal/net.js` is not used anymore. Refs: https://github.com/nodejs/node/pull/11667 PR-URL: https://github.com/nodejs/node/pull/11812 Reviewed-By: James M Snell Reviewed-By: Evan Lucas Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca Reviewed-By: Michaƫl Zasso Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Benjamin Gruenbaum --- lib/internal/net.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/internal/net.js b/lib/internal/net.js index d19bc4c219a796..ce8f549bdfa613 100644 --- a/lib/internal/net.js +++ b/lib/internal/net.js @@ -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) { @@ -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 +};