Skip to content

Commit 799aeca

Browse files
cjihrigtargos
authored andcommitted
http2: respect inspect() depth
This commit causes Http2Stream and Http2Session to account for inspect() depth. PR-URL: #27983Fixes: #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>
1 parent 8b38dfb commit 799aeca

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎lib/internal/http2/core.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ class Http2Session extends EventEmitter {
10731073
}
10741074

10751075
[kInspect](depth,opts){
1076+
if(typeofdepth==='number'&&depth<0)
1077+
returnthis;
1078+
10761079
constobj={
10771080
type: this[kType],
10781081
closed: this.closed,
@@ -1649,6 +1652,9 @@ class Http2Stream extends Duplex {
16491652
}
16501653

16511654
[kInspect](depth,opts){
1655+
if(typeofdepth==='number'&&depth<0)
1656+
returnthis;
1657+
16521658
constobj={
16531659
id: this[kID]||'<pending>',
16541660
closed: this.closed,

0 commit comments

Comments
 (0)