@@ -34,24 +34,24 @@ assert.strictEqual(util.inspect(false), 'false');
34
34
assert . strictEqual ( util . inspect ( '' ) , "''" ) ;
35
35
assert . strictEqual ( util . inspect ( 'hello' ) , "'hello'" ) ;
36
36
assert . strictEqual ( util . inspect ( function abc ( ) { } ) , '[Function: abc]' ) ;
37
- assert . strictEqual ( util . inspect ( ( ) => { } ) , '[Function (anonymous) ]' ) ;
37
+ assert . strictEqual ( util . inspect ( ( ) => { } ) , '[Function]' ) ;
38
38
assert . strictEqual (
39
39
util . inspect ( async function ( ) { } ) ,
40
- '[AsyncFunction (anonymous) ]'
40
+ '[AsyncFunction]'
41
41
) ;
42
- assert . strictEqual ( util . inspect ( async ( ) => { } ) , '[AsyncFunction (anonymous) ]' ) ;
42
+ assert . strictEqual ( util . inspect ( async ( ) => { } ) , '[AsyncFunction]' ) ;
43
43
44
44
// Special function inspection.
45
45
{
46
46
const fn = ( ( ) => function * ( ) { } ) ( ) ;
47
47
assert . strictEqual (
48
48
util . inspect ( fn ) ,
49
- '[GeneratorFunction (anonymous) ]'
49
+ '[GeneratorFunction]'
50
50
) ;
51
51
Object . setPrototypeOf ( fn , Object . getPrototypeOf ( async ( ) => { } ) ) ;
52
52
assert . strictEqual (
53
53
util . inspect ( fn ) ,
54
- '[GeneratorFunction (anonymous) ] AsyncFunction'
54
+ '[GeneratorFunction] AsyncFunction'
55
55
) ;
56
56
Object . defineProperty ( fn , 'name' , { value : 5 , configurable : true } ) ;
57
57
assert . strictEqual (
@@ -454,7 +454,7 @@ assert.strictEqual(
454
454
value . aprop = 42 ;
455
455
assert . strictEqual (
456
456
util . inspect ( value ) ,
457
- '[Function (anonymous) ] { aprop: 42 }'
457
+ '[Function] { aprop: 42 }'
458
458
) ;
459
459
}
460
460
@@ -1485,7 +1485,7 @@ util.inspect(process);
1485
1485
out = util . inspect ( o , { compact : false , breakLength : 3 } ) ;
1486
1486
expect = [
1487
1487
'{' ,
1488
- ' a: [Function (anonymous) ],' ,
1488
+ ' a: [Function],' ,
1489
1489
' b: [Number: 3]' ,
1490
1490
'}'
1491
1491
] . join ( '\n' ) ;
@@ -1494,7 +1494,7 @@ util.inspect(process);
1494
1494
out = util . inspect ( o , { compact : false , breakLength : 3 , showHidden : true } ) ;
1495
1495
expect = [
1496
1496
'{' ,
1497
- ' a: [Function (anonymous) ] {' ,
1497
+ ' a: [Function] {' ,
1498
1498
' [length]: 0,' ,
1499
1499
" [name]: ''" ,
1500
1500
' },' ,
@@ -1811,8 +1811,8 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'");
1811
1811
[ new Number ( 55 ) , '[Number: 55]' ] ,
1812
1812
[ Object ( BigInt ( 55 ) ) , '[BigInt: 55n]' ] ,
1813
1813
[ Object ( Symbol ( 'foo' ) ) , '[Symbol: Symbol(foo)]' ] ,
1814
- [ function ( ) { } , '[Function (anonymous) ]' ] ,
1815
- [ ( ) => { } , '[Function (anonymous) ]' ] ,
1814
+ [ function ( ) { } , '[Function]' ] ,
1815
+ [ ( ) => { } , '[Function]' ] ,
1816
1816
[ [ 1 , 2 ] , '[ 1, 2 ]' ] ,
1817
1817
[ [ , , 5 , , , , ] , '[ <2 empty items>, 5, <3 empty items> ]' ] ,
1818
1818
[ { a : 5 } , '{ a: 5 }' ] ,
@@ -2003,11 +2003,11 @@ assert.strictEqual(
2003
2003
Object . setPrototypeOf ( obj , value ) ;
2004
2004
assert . strictEqual (
2005
2005
util . inspect ( obj ) ,
2006
- '<[Function (null prototype) (anonymous) ]> { a: true }'
2006
+ '<[Function (null prototype)]> { a: true }'
2007
2007
) ;
2008
2008
assert . strictEqual (
2009
2009
util . inspect ( obj , { colors : true } ) ,
2010
- '<\u001b[36m[Function (null prototype) (anonymous) ]\u001b[39m> ' +
2010
+ '<\u001b[36m[Function (null prototype)]\u001b[39m> ' +
2011
2011
'{ a: \u001b[33mtrue\u001b[39m }'
2012
2012
) ;
2013
2013
0 commit comments