diff --git a/lib/internal/http2/core.js b/lib/internal/http2/core.js index e23be01fa42ce4..0351f55afc6b93 100644 --- a/lib/internal/http2/core.js +++ b/lib/internal/http2/core.js @@ -1069,6 +1069,9 @@ class Http2Session extends EventEmitter { } [kInspect](depth, opts) { + if (typeof depth === 'number' && depth < 0) + return this; + const obj = { type: this[kType], closed: this.closed, @@ -1645,6 +1648,9 @@ class Http2Stream extends Duplex { } [kInspect](depth, opts) { + if (typeof depth === 'number' && depth < 0) + return this; + const obj = { id: this[kID] || '', closed: this.closed,