Commit 04bef7aa authored by Rich Trott's avatar Rich Trott
Browse files

util: use assert for unreachable code

Great effort is taken to keep `util.inspect()` from throwing while
inspecting a linked list or other items that require recursion. It is
likely still possible at this time to cause a throw with prototype
pollution, but that will change soon when the code is modified to use
primordials.

This commit instructs our coverage to not be concerned about not being
able to reach the throwing-an-error code and changes the throw there to
an assert so users will be instructed to open a bug with Node.js should
they manage to cause the code to throw.

PR-URL: https://github.com/nodejs/node/pull/37249


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarLuigi Pinca <luigipinca@gmail.com>
Reviewed-By: default avatarAntoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: default avatarDarshan Sen <raisinten@gmail.com>
parent 2084f31e
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment