Commit 06a1c9bf authored by Rich Trott's avatar Rich Trott Committed by Myles Borins
Browse files

assert: remove code that is never reached

The internal function `truncate()` is only called with the first
argument being the output of `util.inspect()`. `util.inspect()` calls
its own internal `formatValue()` which is guaranteed to return a string.

Therefore, we can remove the check in `truncate()` that the first
argument is a string as well as code to handle the case where it is not
a string.

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


Reviewed-By: default avatarMichaël Zasso <targos@protonmail.com>
Reviewed-By: default avatarAlexander Makarenko <estliberitas@gmail.com>
Reviewed-By: default avatarYorkie Liu <yorkiefixer@gmail.com>
Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarColin Ihrig <cjihrig@gmail.com>
parent 9c826bee
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