From 59adf42ae859dab36f785f1762781a8878ae1242 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Tue, 14 May 2019 02:53:22 +0200 Subject: [PATCH] util: include reference anchor for circular structures This adds a reference anchor to circular structures when using `util.inspect`. That way it's possible to identify with what object the circular reference corresponds too. --- doc/api/util.md | 23 +++++++++++++-- lib/internal/util/inspect.js | 27 ++++++++++++++++-- test/parallel/test-assert.js | 3 +- test/parallel/test-util-format.js | 24 ++++++++-------- test/parallel/test-util-inspect.js | 46 ++++++++++++++++++++++-------- 5 files changed, 94 insertions(+), 29 deletions(-) diff --git a/doc/api/util.md b/doc/api/util.md index c0b909d438d15f..28554d5373e2aa 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -390,6 +390,9 @@ stream.write('With ES6');