Skip to content

Commit a20bf75

Browse files
Trotttargos
authored andcommitted
Revert "net: remove usage of require('util')"
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>
1 parent dd2f2cc commit a20bf75

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

lib/net.js

+4-6
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323

2424
const EventEmitter = require('events');
2525
const stream = require('stream');
26-
const { inspect } = require('internal/util/inspect');
27-
const { debuglog } = require('internal/util/debuglog');
26+
const util = require('util');
2827
const internalUtil = require('internal/util');
2928
const {
3029
isIP,
@@ -130,7 +129,7 @@ function getNewAsyncId(handle) {
130129
}
131130

132131

133-
const debug = debuglog('net');
132+
const debug = util.debuglog('net');
134133

135134
function isPipeName(s) {
136135
return typeof s === 'string' && toNumber(s) === false;
@@ -335,8 +334,7 @@ function Socket(options) {
335334
this[kBytesRead] = 0;
336335
this[kBytesWritten] = 0;
337336
}
338-
Object.setPrototypeOf(Socket.prototype, stream.Duplex.prototype);
339-
Object.setPrototypeOf(Socket, stream.Duplex);
337+
util.inherits(Socket, stream.Duplex);
340338

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

1437-
throw new ERR_INVALID_OPT_VALUE('options', inspect(options));
1435+
throw new ERR_INVALID_OPT_VALUE('options', util.inspect(options));
14381436
};
14391437

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

0 commit comments

Comments
 (0)