diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2019-05-14 02:53:22 +0200 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-05-20 14:20:59 +0200 |
commit | 9f71dbc33466f26f3fa9a797ace8aa1f285cb890 (patch) | |
tree | 3b23696e622d2adffd64c72c269e68eacc81c204 /test/parallel/test-assert.js | |
parent | 5518664d41b8916dfbe2eca2180d760db632748e (diff) | |
download | android-node-v8-9f71dbc33466f26f3fa9a797ace8aa1f285cb890.tar.gz android-node-v8-9f71dbc33466f26f3fa9a797ace8aa1f285cb890.tar.bz2 android-node-v8-9f71dbc33466f26f3fa9a797ace8aa1f285cb890.zip |
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 <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'test/parallel/test-assert.js')
-rw-r--r-- | test/parallel/test-assert.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js index 34dc8fabde..d9ba3716a2 100644 --- a/test/parallel/test-assert.js +++ b/test/parallel/test-assert.js @@ -298,7 +298,8 @@ testAssertionMessage({}, '{}'); testAssertionMessage([1, 2, 3], '[\n+ 1,\n+ 2,\n+ 3\n+ ]'); testAssertionMessage(function f() {}, '[Function: f]'); testAssertionMessage(function() {}, '[Function (anonymous)]'); -testAssertionMessage(circular, '{\n+ x: [Circular],\n+ y: 1\n+ }'); +testAssertionMessage(circular, + '<ref *1> {\n+ x: [Circular *1],\n+ y: 1\n+ }'); testAssertionMessage({ a: undefined, b: null }, '{\n+ a: undefined,\n+ b: null\n+ }'); testAssertionMessage({ a: NaN, b: Infinity, c: -Infinity }, |