Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-08-12 22:45:36 +0300
committerMichaƫl Zasso <targos@protonmail.com>2018-09-24 22:37:42 +0300
commit5a13e66088edf95551df5f17bc703790afdf7e1c (patch)
tree86bb029402a71f0a83ba90a222c2505f72c15ecd /test
parent90bbab6f71376c788862e1ac2f27b2f2b1dc69c2 (diff)
util: improve inspect performance
This significantly improves the inspection performance for all array types. From now on only the visible elements cause work instead of having to process all array keys no matter how many entries are visible. This also moves some code out of the main function to reduce the overall function complexity. Backport-PR-URL: https://github.com/nodejs/node/pull/23039 PR-URL: https://github.com/nodejs/node/pull/22503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-util-inspect.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index df1348e95ab..e7585a86146 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -922,7 +922,7 @@ if (typeof Symbol !== 'undefined') {
const set = new Set(['foo']);
set.bar = 42;
assert.strictEqual(
- util.inspect(set, true),
+ util.inspect(set, { showHidden: true }),
"Set { 'foo', [size]: 1, bar: 42 }"
);
}