@@ -145,7 +145,7 @@ assert.strictEqual(
145
145
Object . assign ( new String ( 'hello' ) , { [ Symbol ( 'foo' ) ] : 123 } ) ,
146
146
{ showHidden : true }
147
147
) ,
148
- "[String: 'hello'] { [length]: 5, [ Symbol(foo)] : 123 }"
148
+ "[String: 'hello'] { [length]: 5, Symbol(foo): 123 }"
149
149
) ;
150
150
151
151
assert . match ( util . inspect ( ( new JSStream ( ) ) . _externalStream ) ,
@@ -823,7 +823,7 @@ assert.strictEqual(util.inspect({ __proto__: Date.prototype }), 'Date {}');
823
823
{
824
824
const x = { [ util . inspect . custom ] : util . inspect } ;
825
825
assert ( util . inspect ( x ) . includes (
826
- '[ Symbol(nodejs.util.inspect.custom)] : [Function: inspect] {\n' ) ) ;
826
+ 'Symbol(nodejs.util.inspect.custom): [Function: inspect] {\n' ) ) ;
827
827
}
828
828
829
829
// `util.inspect` should display the escaped value of a key.
@@ -1045,7 +1045,7 @@ util.inspect({ hasOwnProperty: null });
1045
1045
const UIC = 'nodejs.util.inspect.custom' ;
1046
1046
assert . strictEqual (
1047
1047
util . inspect ( subject ) ,
1048
- `{\n a: 123,\n [ Symbol(${ UIC } )] : [Function: [${ UIC } ]]\n}`
1048
+ `{\n a: 123,\n Symbol(${ UIC } ): [Function: [${ UIC } ]]\n}`
1049
1049
) ;
1050
1050
}
1051
1051
@@ -1145,27 +1145,29 @@ if (typeof Symbol !== 'undefined') {
1145
1145
1146
1146
subject [ Symbol ( 'sym\nbol' ) ] = 42 ;
1147
1147
1148
- assert . strictEqual ( util . inspect ( subject ) , '{ [ Symbol(sym\\nbol)] : 42 }' ) ;
1148
+ assert . strictEqual ( util . inspect ( subject ) , '{ Symbol(sym\\nbol): 42 }' ) ;
1149
1149
assert . strictEqual (
1150
1150
util . inspect ( subject , options ) ,
1151
- '{ [ Symbol(sym\\nbol)] : 42 }'
1151
+ '{ Symbol(sym\\nbol): 42 }'
1152
1152
) ;
1153
1153
1154
1154
Object . defineProperty (
1155
1155
subject ,
1156
1156
Symbol ( ) ,
1157
1157
{ enumerable : false , value : 'non-enum' } ) ;
1158
- assert . strictEqual ( util . inspect ( subject ) , '{ [ Symbol(sym\\nbol)] : 42 }' ) ;
1158
+ assert . strictEqual ( util . inspect ( subject ) , '{ Symbol(sym\\nbol): 42 }' ) ;
1159
1159
assert . strictEqual (
1160
1160
util . inspect ( subject , options ) ,
1161
- "{ [ Symbol(sym\\nbol)] : 42, [Symbol()]: 'non-enum' }"
1161
+ "{ Symbol(sym\\nbol): 42, [Symbol()]: 'non-enum' }"
1162
1162
) ;
1163
1163
1164
1164
subject = [ 1 , 2 , 3 ] ;
1165
1165
subject [ Symbol ( 'symbol' ) ] = 42 ;
1166
1166
1167
- assert . strictEqual ( util . inspect ( subject ) ,
1168
- '[ 1, 2, 3, [Symbol(symbol)]: 42 ]' ) ;
1167
+ assert . strictEqual (
1168
+ util . inspect ( subject ) ,
1169
+ '[ 1, 2, 3, Symbol(symbol): 42 ]'
1170
+ ) ;
1169
1171
}
1170
1172
1171
1173
// Test Set.
@@ -1589,7 +1591,7 @@ util.inspect(process);
1589
1591
const obj = { [ util . inspect . custom ] : 'fhqwhgads' } ;
1590
1592
assert . strictEqual (
1591
1593
util . inspect ( obj ) ,
1592
- "{ [ Symbol(nodejs.util.inspect.custom)] : 'fhqwhgads' }"
1594
+ "{ Symbol(nodejs.util.inspect.custom): 'fhqwhgads' }"
1593
1595
) ;
1594
1596
}
1595
1597
@@ -1598,7 +1600,7 @@ util.inspect(process);
1598
1600
const obj = { [ Symbol . toStringTag ] : 'a' } ;
1599
1601
assert . strictEqual (
1600
1602
util . inspect ( obj ) ,
1601
- "{ [ Symbol(Symbol.toStringTag)] : 'a' }"
1603
+ "{ Symbol(Symbol.toStringTag): 'a' }"
1602
1604
) ;
1603
1605
Object . defineProperty ( obj , Symbol . toStringTag , {
1604
1606
value : 'a' ,
@@ -2268,7 +2270,7 @@ assert.strictEqual(util.inspect('"\'${a}'), "'\"\\'${a}'");
2268
2270
value [ Symbol ( 'foo' ) ] = 'yeah' ;
2269
2271
res = util . inspect ( value ) ;
2270
2272
assert . notStrictEqual ( res , expectedWithoutProto ) ;
2271
- assert . match ( res , / \[ S y m b o l \( f o o \) ] : ' y e a h ' / ) ;
2273
+ assert . match ( res , / S y m b o l \( f o o \) : ' y e a h ' / ) ;
2272
2274
} ) ;
2273
2275
2274
2276
assert . strictEqual ( inspect ( 1n ) , '1n' ) ;
@@ -2284,7 +2286,7 @@ assert.strictEqual(
2284
2286
Object . defineProperty ( obj , 'Non\nenumerable\tkey' , { value : true } ) ;
2285
2287
assert . strictEqual (
2286
2288
util . inspect ( obj , { showHidden : true } ) ,
2287
- '{ [Non\\nenumerable\\tkey]: true }'
2289
+ '{ [\' Non\\nenumerable\\tkey\' ]: true }'
2288
2290
) ;
2289
2291
}
2290
2292
@@ -2375,7 +2377,7 @@ assert.strictEqual(
2375
2377
arr [ Symbol ( 'a' ) ] = false ;
2376
2378
assert . strictEqual (
2377
2379
inspect ( arr , { sorted : true } ) ,
2378
- '[ 3, 2, 1, [ Symbol(a)] : false, [ Symbol(b)] : true, a: 1, b: 2, c: 3 ]'
2380
+ '[ 3, 2, 1, Symbol(a): false, Symbol(b): true, a: 1, b: 2, c: 3 ]'
2379
2381
) ;
2380
2382
}
2381
2383
@@ -3263,7 +3265,7 @@ assert.strictEqual(
3263
3265
Object . defineProperty ( o , '__proto__' , { enumerable : false } ) ;
3264
3266
assert . strictEqual (
3265
3267
util . inspect ( o , { showHidden : true } ) ,
3266
- "{ ['__proto__']: { a: 1 } }"
3268
+ "{ [[ '__proto__'] ]: { a: 1 } }"
3267
3269
) ;
3268
3270
}
3269
3271
@@ -3328,11 +3330,11 @@ assert.strictEqual(
3328
3330
get [ Symbol . iterator ] ( ) {
3329
3331
throw new Error ( ) ;
3330
3332
}
3331
- } ) , '{ [ Symbol(Symbol.iterator)] : [Getter] }' ) ;
3333
+ } ) , '{ Symbol(Symbol.iterator): [Getter] }' ) ;
3332
3334
}
3333
3335
3334
3336
{
3335
- const sym = Symbol ( 'bar' ) ;
3337
+ const sym = Symbol ( 'bar() ' ) ;
3336
3338
const o = {
3337
3339
foo : 0 ,
3338
3340
'Symbol(foo)' : 0 ,
@@ -3347,9 +3349,9 @@ assert.strictEqual(
3347
3349
'{\n' +
3348
3350
' foo: 0,\n' +
3349
3351
" 'Symbol(foo)': 0,\n" +
3350
- ' [ Symbol(foo)] : 0,\n' +
3351
- ' [ Symbol(foo())] : 0,\n' +
3352
- ' [Symbol(bar)]: 0\n' +
3352
+ ' Symbol(foo): 0,\n' +
3353
+ ' Symbol(foo()): 0,\n' +
3354
+ ' [Symbol(bar() )]: 0\n' +
3353
3355
'}'
3354
3356
)
3355
3357
}
0 commit comments