summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-inspect-proxy.js
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2018-04-13 21:40:28 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2018-05-11 17:46:56 +0200
commit849aaaeeb045965f3f8085c7cb65c3c830bd724c (patch)
tree0beefed2ec9fe936e2de381627f66b4dd3860896 /test/parallel/test-util-inspect-proxy.js
parent85373aeb4c79dd16bf22549559cf09df17d78e5a (diff)
downloadandroid-node-v8-849aaaeeb045965f3f8085c7cb65c3c830bd724c.tar.gz
android-node-v8-849aaaeeb045965f3f8085c7cb65c3c830bd724c.tar.bz2
android-node-v8-849aaaeeb045965f3f8085c7cb65c3c830bd724c.zip
Revert "util: change util.inspect depth default"
This reverts commit b994b8eff6018433a56bb10dbc473cefa0dd9370. This caused regressions in ecosystem code. While the change originally was semver-major and could be postponed until after Node.js 10, I think reverting it is a good choice at this point. Also, I personally do not think defaulting to a shallow inspect is a bad thing at all – quite the opposite: It makes `util.inspect()` give an overview of an object, rather than providing a full display of its contents. Changing the `depth` default to infinity fundamentally changed the role that `util.inspect()` plays, and makes output much more verbose and thus at times unusable for `console.log()`-style debugging. PR-URL: https://github.com/nodejs/node/pull/20017 Fixes: https://github.com/nodejs/node/issues/19405 Refs: https://github.com/nodejs/node/pull/17907 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'test/parallel/test-util-inspect-proxy.js')
-rw-r--r--test/parallel/test-util-inspect-proxy.js16
1 files changed, 6 insertions, 10 deletions
diff --git a/test/parallel/test-util-inspect-proxy.js b/test/parallel/test-util-inspect-proxy.js
index bc53c1fe68..d7fb28ddc7 100644
--- a/test/parallel/test-util-inspect-proxy.js
+++ b/test/parallel/test-util-inspect-proxy.js
@@ -48,17 +48,13 @@ const expected1 = 'Proxy [ {}, {} ]';
const expected2 = 'Proxy [ Proxy [ {}, {} ], {} ]';
const expected3 = 'Proxy [ Proxy [ Proxy [ {}, {} ], {} ], Proxy [ {}, {} ] ]';
const expected4 = 'Proxy [ Proxy [ {}, {} ], Proxy [ Proxy [ {}, {} ], {} ] ]';
-const expected5 = 'Proxy [ Proxy [ Proxy [ Proxy [ {}, {} ], {} ],' +
+const expected5 = 'Proxy [ Proxy [ Proxy [ Proxy [Array], {} ],' +
' Proxy [ {}, {} ] ],\n Proxy [ Proxy [ {}, {} ]' +
- ', Proxy [ Proxy [ {}, {} ], {} ] ] ]';
-const expected6 = 'Proxy [ Proxy [ Proxy [ Proxy [ Proxy [ {}, {} ], {} ], ' +
- 'Proxy [ {}, {} ] ],\n' +
- ' Proxy [ Proxy [ {}, {} ], ' +
- 'Proxy [ Proxy [ {}, {} ], {} ] ] ],\n' +
- ' Proxy [ Proxy [ Proxy [ Proxy [ {}, {} ], {} ], ' +
- 'Proxy [ {}, {} ] ],\n' +
- ' Proxy [ Proxy [ {}, {} ], ' +
- 'Proxy [ Proxy [ {}, {} ], {} ] ] ] ]';
+ ', Proxy [ Proxy [Array], {} ] ] ]';
+const expected6 = 'Proxy [ Proxy [ Proxy [ Proxy [Array], Proxy [Array]' +
+ ' ],\n Proxy [ Proxy [Array], Proxy [Array] ] ],\n' +
+ ' Proxy [ Proxy [ Proxy [Array], Proxy [Array] ],\n' +
+ ' Proxy [ Proxy [Array], Proxy [Array] ] ] ]';
assert.strictEqual(
util.inspect(proxy1, { showProxy: true, depth: null }),
expected1);