Unverified Commit a60ed891 authored by Anna Henningsen's avatar Anna Henningsen
Browse files

util: allow returning `this` from custom inspect

If a custom inspection function returned `this`, use that value
for further formatting instead of going into infinite recursion.

This is particularly useful when combined with `util.inspect.custom`
because returning `this` from such a method makes it easy to
have an `inspect()` function that is ignored by `util.inspect` without
actually having to provide an alternative for custom inspection.

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


Reviewed-By: default avatarJames M Snell <jasnell@gmail.com>
Reviewed-By: default avatarMichaël Zasso <mic.besace@gmail.com>
parent 59714cb7
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