diff --git a/lib/net.js b/lib/net.js index 20b0ede7b78b3b..190f40c38f78b6 100644 --- a/lib/net.js +++ b/lib/net.js @@ -64,18 +64,22 @@ const { onStreamRead, kUpdateTimer } = require('internal/stream_base_commons'); -const errors = require('internal/errors'); const { - ERR_INVALID_ADDRESS_FAMILY, - ERR_INVALID_ARG_TYPE, - ERR_INVALID_FD_TYPE, - ERR_INVALID_IP_ADDRESS, - ERR_INVALID_OPT_VALUE, - ERR_SERVER_ALREADY_LISTEN, - ERR_SERVER_NOT_RUNNING, - ERR_SOCKET_BAD_PORT, - ERR_SOCKET_CLOSED -} = errors.codes; + codes: { + ERR_INVALID_ADDRESS_FAMILY, + ERR_INVALID_ARG_TYPE, + ERR_INVALID_FD_TYPE, + ERR_INVALID_IP_ADDRESS, + ERR_INVALID_OPT_VALUE, + ERR_SERVER_ALREADY_LISTEN, + ERR_SERVER_NOT_RUNNING, + ERR_SOCKET_BAD_PORT, + ERR_SOCKET_CLOSED + }, + errnoException, + exceptionWithHostPort, + uvExceptionWithHostPort +} = require('internal/errors'); const { validateInt32, validateString } = require('internal/validators'); const kLastWriteQueueSize = Symbol('lastWriteQueueSize'); @@ -83,12 +87,6 @@ const kLastWriteQueueSize = Symbol('lastWriteQueueSize'); let cluster; let dns; -const { - errnoException, - exceptionWithHostPort, - uvExceptionWithHostPort -} = errors; - const { kTimeout, setUnrefTimeout,