Please sign in to comment.
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: #8174 Reviewed-By: James M Snell <email@example.com> Reviewed-By: Michaël Zasso <firstname.lastname@example.org> Refs: #8437 Reviewed-By: James M Snell <email@example.com> Reviewed-By: Jeremiah Senkpiel <firstname.lastname@example.org>
- Loading branch information...
Showing with 18 additions and 3 deletions.