|
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,
|
@@ -130,7 +131,7 @@ function getNewAsyncId(handle) {
|
130 | 131 | }
|
131 | 132 |
|
132 | 133 |
|
133 |
| -const debug = util.debuglog('net'); |
| 134 | +const debug = debuglog('net'); |
134 | 135 |
|
135 | 136 | function isPipeName(s) {
|
136 | 137 | return typeof s === 'string' && toNumber(s) === false;
|
@@ -335,7 +336,8 @@ function Socket(options) {
|
335 | 336 | this[kBytesRead] = 0;
|
336 | 337 | this[kBytesWritten] = 0;
|
337 | 338 | }
|
338 |
| -util.inherits(Socket, stream.Duplex); |
| 339 | +Object.setPrototypeOf(Socket.prototype, stream.Duplex.prototype); |
| 340 | +Object.setPrototypeOf(Socket, stream.Duplex); |
339 | 341 |
|
340 | 342 | // Refresh existing timeouts.
|
341 | 343 | Socket.prototype._unrefTimer = function _unrefTimer() {
|
@@ -1412,7 +1414,7 @@ Server.prototype.listen = function(...args) {
|
1412 | 1414 | 'must have the property "port" or "path"');
|
1413 | 1415 | }
|
1414 | 1416 |
|
1415 |
| - throw new ERR_INVALID_OPT_VALUE('options', util.inspect(options)); |
| 1417 | + throw new ERR_INVALID_OPT_VALUE('options', inspect(options)); |
1416 | 1418 | };
|
1417 | 1419 |
|
1418 | 1420 | function lookupAndListen(self, port, address, backlog, exclusive, flags) {
|
|
0 commit comments