diff options
author | Rich Trott <rtrott@gmail.com> | 2019-03-24 18:53:41 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-03-24 19:42:58 -0700 |
commit | 3f41fcbe83d1cc600f305977c9a058143b1d83f7 (patch) | |
tree | 0565a36ef9c2bcdd1acfe682fe565a44cf24e254 /lib/net.js | |
parent | 85fda7e8481003ec0d6b5217c90440ad79dc2204 (diff) | |
download | android-node-v8-3f41fcbe83d1cc600f305977c9a058143b1d83f7.tar.gz android-node-v8-3f41fcbe83d1cc600f305977c9a058143b1d83f7.tar.bz2 android-node-v8-3f41fcbe83d1cc600f305977c9a058143b1d83f7.zip |
Revert "net: remove usage of require('util')"
This reverts commit e112fb4c221f9749fd9271c95a5f544476511292.
This commit broke parallel/test-net-access-byteswritten.
PR-URL: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'lib/net.js')
-rw-r--r-- | lib/net.js | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/net.js b/lib/net.js index 1c14df01cc..a5f012ac33 100644 --- a/lib/net.js +++ b/lib/net.js @@ -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, @@ -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; @@ -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() { @@ -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) { |