summaryrefslogtreecommitdiff
path: root/lib/timers.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-09-27 00:22:12 +0200
committerDaniel Bevenius <daniel.bevenius@gmail.com>2018-10-02 05:33:57 +0200
commitd8baf67d4af2a9e388c82eccab2d3366a0a61c7e (patch)
tree1e44af02284b2ef60b61aba9cba5a1854b8bb9f6 /lib/timers.js
parent69f1a2bb85b523619cdb7f673b1603d8e8391713 (diff)
downloadandroid-node-v8-d8baf67d4af2a9e388c82eccab2d3366a0a61c7e.tar.gz
android-node-v8-d8baf67d4af2a9e388c82eccab2d3366a0a61c7e.tar.bz2
android-node-v8-d8baf67d4af2a9e388c82eccab2d3366a0a61c7e.zip
timers: use custom inspection for linked lists
Inspecting linked lists is something that is not really useful. Instead, just use a custom inspection function and hide everything besides the first level. PR-URL: https://github.com/nodejs/node/pull/23108 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Diffstat (limited to 'lib/timers.js')
-rw-r--r--lib/timers.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/timers.js b/lib/timers.js
index dc9b875ec3..0c5d7b07b2 100644
--- a/lib/timers.js
+++ b/lib/timers.js
@@ -239,6 +239,17 @@ function TimersList(expiry, msecs) {
this.priorityQueuePosition = null;
}
+// Make sure the linked list only shows the minimal necessary information.
+TimersList.prototype[util.inspect.custom] = function(_, options) {
+ return util.inspect(this, {
+ ...options,
+ // Only inspect one level.
+ depth: 0,
+ // It should not recurse.
+ customInspect: false
+ });
+};
+
const { _tickCallback: runNextTicks } = process;
function processTimers(now) {
debug('process timer lists %d', now);