diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2019-08-29 16:56:27 +0200 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-08-29 10:56:26 -0400 |
commit | b5a5e973842fed271210ce919a309745b9bfa30a (patch) | |
tree | 2927084b9d6633fb2d3243761c07ad9889c26ab5 /js/console.ts | |
parent | 23215a83498d27f632b61686f64998ec48fd9943 (diff) |
add console.dirxml (#2835)
Diffstat (limited to 'js/console.ts')
-rw-r--r-- | js/console.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/js/console.ts b/js/console.ts index ed2543a9d..db6a87296 100644 --- a/js/console.ts +++ b/js/console.ts @@ -526,6 +526,18 @@ export class Console { this.printFunc(stringifyArgs([obj], options) + "\n", false); }; + /** From MDN: + * Displays an interactive tree of the descendant elements of + * the specified XML/HTML element. If it is not possible to display + * as an element the JavaScript Object view is shown instead. + * The output is presented as a hierarchical listing of expandable + * nodes that let you see the contents of child nodes. + * + * Since we write to stdout, we can't display anything interactive + * we just fall back to `console.dir`. + */ + dirxml = this.dir; + /** Writes the arguments to stdout */ warn = (...args: unknown[]): void => { this.printFunc( |