From 6319499514475a9c91a9e279bd9af4b6246ef008 Mon Sep 17 00:00:00 2001 From: Benjamin Zaslavsky Date: Wed, 22 Nov 2017 22:53:20 +0100 Subject: [PATCH] console: rework console.dirxml to call console.dir on each argument received. Minimal implementation following the Living Standard specs, following reviews. Fixes: https://github.com/nodejs/node/issues/17128 --- doc/api/console.md | 28 ++++++++++++++++------------ lib/console.js | 14 +------------- test/parallel/test-console.js | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 25 deletions(-) diff --git a/doc/api/console.md b/doc/api/console.md index ba1505ec1d0f21..ac020c6b1bf9d0 100644 --- a/doc/api/console.md +++ b/doc/api/console.md @@ -277,6 +277,21 @@ Defaults to `2`. To make it recurse indefinitely, pass `null`. Defaults to `false`. Colors are customizable; see [customizing `util.inspect()` colors][]. +### console.dirxml(...data) + +* `...data` {any} + +This method calls `console.dir()` with default options for each argument it +receives. See [`console.dir()`][] for more details about said defaults. +Please note that this method doesn't produce any xml formatting and uses the +default `console.dir()` formatting resolution instead. + ### console.error([data][, ...args]) -* `object` {string} - -This method does not display anything unless used in the inspector. The -`console.dirxml()` method displays in `stdout` an XML interactive tree -representation of the descendants of the specified `object` if possible, or the -JavaScript representation if not. Calling `console.dirxml()` on an HTML or XML -element is equivalent to calling `console.log()`. - ### console.markTimeline(label)