Skip to content

Commit b047930

Browse files
committedJul 9, 2020
quic: proper custom inspect for QuicSocket
PR-URL: #34247 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 511f8c1 commit b047930

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed
 

‎lib/internal/quic/core.js

+11-7
Original file line numberDiff line numberDiff line change
@@ -977,14 +977,18 @@ class QuicSocket extends EventEmitter {
977977
}
978978
}
979979

980-
[kInspect]() {
981-
// TODO(@jasnell): Proper custom inspect implementation
982-
const state = this[kInternalState];
983-
const obj = {
980+
[kInspect](depth, options) {
981+
return customInspect(this, {
984982
endpoints: this.endpoints,
985-
sessions: state.sessions,
986-
};
987-
return `QuicSocket ${util.format(obj)}`;
983+
sessions: this.sessions,
984+
bound: this.bound,
985+
pending: this.pending,
986+
closing: this.closing,
987+
destroyed: this.destroyed,
988+
listening: this.listening,
989+
serverBusy: this.serverBusy,
990+
statelessResetDisabled: this.statelessResetDisabled,
991+
}, depth, options);
988992
}
989993

990994
[kAddSession](session) {

0 commit comments

Comments
 (0)