util: inspect objects with throwing Symbol.toStringTag · nodejs/node@3c62b38 · GitHub
Skip to content

Commit 3c62b38

Browse files
BridgeARtargos
authored andcommitted
util: inspect objects with throwing Symbol.toStringTag
`util.inspect()` should handle all kinds of input, even if it is not well defined. Throwing is something that is meant to be worked around in all known cases. This fixes issues inspecting objects where accessing the Symbol.toStringTag would cause an error. The symbol is just ignored in that case. Refs: #55539 Refs: #55544 PR-URL: #59860 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 6133a82 commit 3c62b38

2 files changed

Lines changed: 14 additions & 3 deletions

File tree

lib/internal/util/inspect.js

Lines changed: 8 additions & 1 deletion

test/parallel/test-util-inspect.js

Lines changed: 6 additions & 2 deletions

0 commit comments

Comments
 (0)