summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2017-03-26 01:28:23 +0100
committerJames M Snell <jasnell@gmail.com>2017-03-28 13:11:07 -0700
commit4a5a9445b542333ac7cd8e3ea39ac784a16ccd97 (patch)
tree3a673687c440850415c7c451c5738fa1d7ce522b /lib
parentcd4ddfdef25f6faaeee452a1c492cc6806da6341 (diff)
downloadandroid-node-v8-4a5a9445b542333ac7cd8e3ea39ac784a16ccd97.tar.gz
android-node-v8-4a5a9445b542333ac7cd8e3ea39ac784a16ccd97.tar.bz2
android-node-v8-4a5a9445b542333ac7cd8e3ea39ac784a16ccd97.zip
util: use `[Array]` for deeply nested arrays
Prefer `[Array]` over `[Object]` because the latter is confusing. PR-URL: https://github.com/nodejs/node/pull/12046 Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/util.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/util.js b/lib/util.js
index 80195c2672..fa750d363b 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -586,6 +586,8 @@ function formatValue(ctx, value, recurseTimes) {
if (recurseTimes < 0) {
if (isRegExp(value)) {
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
+ } else if (Array.isArray(value)) {
+ return ctx.stylize('[Array]', 'special');
} else {
return ctx.stylize('[Object]', 'special');
}