File tree Expand file tree Collapse file tree 3 files changed +9
-19
lines changed Expand file tree Collapse file tree 3 files changed +9
-19
lines changed Original file line number Diff line number Diff line change @@ -282,15 +282,13 @@ Defaults to `false`. Colors are customizable; see
282282added: v8.0.0
283283changes:
284284 - version: REPLACEME
285- pr-url: https://github.com/nodejs/node/pull/17128
286- description: "`console.dirxml` now calls `console.dir ` for each argument ."
285+ pr-url: https://github.com/nodejs/node/pull/17152
286+ description: "`console.dirxml` now calls `console.log ` for its arguments ."
287287-->
288288* ` ...data ` {any}
289289
290- This method calls ` console.dir() ` with default options for each argument it
291- receives. See [ ` console.dir() ` ] [ ] for more details about said defaults.
292- Please note that this method doesn't produce any xml formatting and uses the
293- default ` console.dir() ` formatting resolution instead.
290+ This method calls ` console.log() ` passing it the arguments received.
291+ Please note that this method does not produce any XML formatting.
294292
295293### console.error([ data] [ , ...args ] )
296294<!-- YAML
@@ -524,7 +522,6 @@ added: v8.0.0
524522This method does not display anything unless used in the inspector. The
525523` console.timelineEnd() ` method is the deprecated form of [ ` console.timeEnd() ` ] [ ] .
526524
527- [ `console.dir()` ] : #console_console_dir_obj_options
528525[ `console.error()` ] : #console_console_error_data_args
529526[ `console.group()` ] : #console_console_group_label
530527[ `console.log()` ] : #console_console_log_data_args
Original file line number Diff line number Diff line change @@ -162,11 +162,7 @@ Console.prototype.dir = function dir(object, options) {
162162} ;
163163
164164
165- Console . prototype . dirxml = function dirxml ( ...data ) {
166- for ( const item of data ) {
167- Console . prototype . dir . call ( this , item ) ;
168- }
169- } ;
165+ Console . prototype . dirxml = Console . prototype . log ;
170166
171167
172168Console . prototype . time = function time ( label = 'default' ) {
Original file line number Diff line number Diff line change @@ -179,13 +179,10 @@ assert.strictEqual(strings.shift(),
179179 "{ foo: 'bar', inspect: [Function: inspect] }\n" ) ;
180180assert . ok ( strings . shift ( ) . includes ( 'foo: [Object]' ) ) ;
181181assert . strictEqual ( strings . shift ( ) . includes ( 'baz' ) , false ) ;
182- assert . strictEqual ( strings . shift ( ) ,
183- "{ foo: 'bar', inspect: [Function: inspect] }\n" ) ;
184- assert . strictEqual ( strings . shift ( ) ,
185- "{ foo: 'bar', inspect: [Function: inspect] }\n" ) ;
186- assert . strictEqual ( strings . shift ( ) . includes ( 'foo: { bar: { baz:' ) , true ) ;
187- assert . strictEqual ( strings . shift ( ) . includes ( 'quux' ) , true ) ;
188- assert . strictEqual ( strings . shift ( ) . includes ( 'quux: true' ) , true ) ;
182+ assert . strictEqual ( strings . shift ( ) , 'inspect inspect\n' ) ;
183+ assert . ok ( strings [ 0 ] . includes ( 'foo: { bar: { baz:' ) ) ;
184+ assert . ok ( strings [ 0 ] . includes ( 'quux' ) ) ;
185+ assert . ok ( strings . shift ( ) . includes ( 'quux: true' ) ) ;
189186
190187assert . ok ( / ^ l a b e l : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
191188assert . ok ( / ^ _ _ p r o t o _ _ : \d + \. \d { 3 } m s $ / . test ( strings . shift ( ) . trim ( ) ) ) ;
You can’t perform that action at this time.
0 commit comments