From 9f71dbc33466f26f3fa9a797ace8aa1f285cb890 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. PR-URL: https://github.com/nodejs/node/pull/27685 Reviewed-By: Anna Henningsen Reviewed-By: Benjamin Gruenbaum Reviewed-By: Rich Trott Reviewed-By: Anto Aravinth Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- 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 301089fd47c..111259f82cf 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -392,6 +392,9 @@ stream.write('With ES6');