Skip to content

Commit

Permalink
Revert "net: remove usage of require('util')"
Browse files Browse the repository at this point in the history
This reverts commit e112fb4.
This commit broke parallel/test-net-access-byteswritten.

PR-URL: #26896
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
Trott authored and targos committed Mar 27, 2019
1 parent dd2f2cc commit a20bf75
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

const EventEmitter = require('events');
const stream = require('stream');
const { inspect } = require('internal/util/inspect');
const { debuglog } = require('internal/util/debuglog');
const util = require('util');
const internalUtil = require('internal/util');
const {
isIP,
Expand Down Expand Up @@ -130,7 +129,7 @@ function getNewAsyncId(handle) {
}


const debug = debuglog('net');
const debug = util.debuglog('net');

function isPipeName(s) {
return typeof s === 'string' && toNumber(s) === false;
Expand Down Expand Up @@ -335,8 +334,7 @@ function Socket(options) {
this[kBytesRead] = 0;
this[kBytesWritten] = 0;
}
Object.setPrototypeOf(Socket.prototype, stream.Duplex.prototype);
Object.setPrototypeOf(Socket, stream.Duplex);
util.inherits(Socket, stream.Duplex);

// Refresh existing timeouts.
Socket.prototype._unrefTimer = function _unrefTimer() {
Expand Down Expand Up @@ -1434,7 +1432,7 @@ Server.prototype.listen = function(...args) {
'must have the property "port" or "path"');
}

throw new ERR_INVALID_OPT_VALUE('options', inspect(options));
throw new ERR_INVALID_OPT_VALUE('options', util.inspect(options));
};

function lookupAndListen(self, port, address, backlog, exclusive, flags) {
Expand Down

0 comments on commit a20bf75

Please sign in to comment.