Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "net: remove usage of require('util')" #26896

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -131,7 +130,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 @@ -336,8 +335,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 @@ -1414,7 +1412,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