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