util: fix inspection of errors with tampered name or stack property
This makes sure that util.inspect()
does not throw while inspecting
errors that have the name or stack property set to a different type
than string.
Fixes: https://github.com/nodejs/node/issues/30572
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines