http2: respect inspect() depth
This commit causes Http2Stream and Http2Session to account for inspect() depth. PR-URL: https://github.com/nodejs/node/pull/27983 Fixes: https://github.com/nodejs/node/issues/27976 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
2983eaca84
commit
f86100caf3
@ -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] || '<pending>',
|
||||
closed: this.closed,
|
||||
|
Loading…
x
Reference in New Issue
Block a user