|
23 | 23 |
|
24 | 24 | const EventEmitter = require('events');
|
25 | 25 | const stream = require('stream');
|
26 |
| -const util = require('util'); |
| 26 | +const { inspect } = require('internal/util/inspect'); |
| 27 | +const { debuglog } = require('internal/util/debuglog'); |
27 | 28 | const internalUtil = require('internal/util');
|
28 | 29 | const {
|
29 | 30 | isIP,
|
@@ -129,7 +130,7 @@ function getNewAsyncId(handle) {
|
129 | 130 | }
|
130 | 131 |
|
131 | 132 |
|
132 |
| -const debug = util.debuglog('net'); |
| 133 | +const debug = debuglog('net'); |
133 | 134 |
|
134 | 135 | function isPipeName(s) {
|
135 | 136 | return typeof s === 'string' && toNumber(s) === false;
|
@@ -334,7 +335,8 @@ function Socket(options) {
|
334 | 335 | this[kBytesRead] = 0;
|
335 | 336 | this[kBytesWritten] = 0;
|
336 | 337 | }
|
337 |
| -util.inherits(Socket, stream.Duplex); |
| 338 | +Object.setPrototypeOf(Socket.prototype, stream.Duplex.prototype); |
| 339 | +Object.setPrototypeOf(Socket, stream.Duplex); |
338 | 340 |
|
339 | 341 | // Refresh existing timeouts.
|
340 | 342 | Socket.prototype._unrefTimer = function _unrefTimer() {
|
@@ -1432,7 +1434,7 @@ Server.prototype.listen = function(...args) {
|
1432 | 1434 | 'must have the property "port" or "path"');
|
1433 | 1435 | }
|
1434 | 1436 |
|
1435 |
| - throw new ERR_INVALID_OPT_VALUE('options', util.inspect(options)); |
| 1437 | + throw new ERR_INVALID_OPT_VALUE('options', inspect(options)); |
1436 | 1438 | };
|
1437 | 1439 |
|
1438 | 1440 | function lookupAndListen(self, port, address, backlog, exclusive, flags) {
|
|
0 commit comments