Skip to content

Commit

Permalink
quic: proper custom inspect for QuicSocket
Browse files Browse the repository at this point in the history
PR-URL: #34247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
  • Loading branch information
jasnell committed Jul 9, 2020
1 parent 511f8c1 commit b047930
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/internal/quic/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -977,14 +977,18 @@ class QuicSocket extends EventEmitter {
}
}

[kInspect]() {
// TODO(@jasnell): Proper custom inspect implementation
const state = this[kInternalState];
const obj = {
[kInspect](depth, options) {
return customInspect(this, {
endpoints: this.endpoints,
sessions: state.sessions,
};
return `QuicSocket ${util.format(obj)}`;
sessions: this.sessions,
bound: this.bound,
pending: this.pending,
closing: this.closing,
destroyed: this.destroyed,
listening: this.listening,
serverBusy: this.serverBusy,
statelessResetDisabled: this.statelessResetDisabled,
}, depth, options);
}

[kAddSession](session) {
Expand Down

0 comments on commit b047930

Please sign in to comment.