quic: proper custom inspect for QuicStream

PR-URL: https://github.com/nodejs/node/pull/34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
James M Snell committed 2020-07-09 07:15:44 -07:00
1 parent 0860b11655
commit 458d243f20
1 file changed
+4 -11
+4 -11
View File
@@ -44,7 +44,6 @@ const {
QuicSessionSharedState,
QLogStream,
} = require('internal/quic/util');
const util = require('util');
const assert = require('internal/assert');
const EventEmitter = require('events');
const fs = require('fs');
@@ -2713,23 +2712,17 @@ class QuicStream extends Duplex {
// TODO(@jasnell): Implement this
}
[kInspect]() {
[kInspect](depth, options) {
// TODO(@jasnell): Proper custom inspect implementation
const direction = this.bidirectional ? 'bidirectional' : 'unidirectional';
const initiated = this.serverInitiated ? 'server' : 'client';
const obj = {
return customInspect(this, {
id: this[kInternalState].id,
direction,
initiated,
writableState: this._writableState,
readableState: this._readableState,
stats: {
dataRate: this.dataRateHistogram,
dataSize: this.dataSizeHistogram,
dataAck: this.dataAckHistogram,
}
};
return `QuicStream ${util.format(obj)}`;
readableState: this._readableState
}, depth, options);
}
[kTrackWriteState](stream, bytes) {