@@ -235,43 +235,21 @@ for (const showHidden of [true, false]) {
235
235
) ;
236
236
} ) ;
237
237
238
- // Due to the hash seed randomization it's not deterministic the order that
239
- // the following ways this hash is displayed.
240
- // See http://codereview.chromium.org/9124004/
241
-
242
- {
243
- const out =
244
- util . inspect (
245
- Object . create (
246
- { } ,
247
- { visible : { value : 1 , enumerable : true } , hidden : { value : 2 } }
248
- ) ,
249
- true
250
- ) ;
251
- if ( out !== '{ [hidden]: 2, visible: 1 }' &&
252
- out !== '{ visible: 1, [hidden]: 2 }' ) {
253
- assert . fail ( `unexpected value for out ${ out } ` ) ;
254
- }
255
- }
256
-
238
+ assert . strictEqual (
239
+ util . inspect ( Object . create ( { } , {
240
+ visible : { value : 1 , enumerable : true } ,
241
+ hidden : { value : 2 }
242
+ } ) , { showHidden : true } ) ,
243
+ '{ visible: 1, [hidden]: 2 }'
244
+ ) ;
257
245
// Objects without prototype
258
- {
259
- const out =
260
- util . inspect ( Object . create ( null ,
261
- {
262
- name : {
263
- value : 'Tim' ,
264
- enumerable : true
265
- } ,
266
- hidden : {
267
- value : 'secret'
268
- }
269
- } ) , true ) ;
270
- if ( out !== "{ [hidden]: 'secret', name: 'Tim' }" &&
271
- out !== "{ name: 'Tim', [hidden]: 'secret' }" ) {
272
- assert . fail ( `unexpected value for out ${ out } ` ) ;
273
- }
274
- }
246
+ assert . strictEqual (
247
+ util . inspect ( Object . create ( null , {
248
+ name : { value : 'Tim' , enumerable : true } ,
249
+ hidden : { value : 'secret' }
250
+ } ) , { showHidden : true } ) ,
251
+ "{ name: 'Tim', [hidden]: 'secret' }"
252
+ ) ;
275
253
276
254
assert . strictEqual (
277
255
util . inspect ( Object . create ( null ,
@@ -280,7 +258,6 @@ assert.strictEqual(
280
258
'{ name: \'Tim\' }'
281
259
) ;
282
260
283
-
284
261
// Dynamic properties
285
262
{
286
263
assert . strictEqual ( util . inspect ( { get readonly ( ) { } } ) ,
@@ -1061,19 +1038,11 @@ if (typeof Symbol !== 'undefined') {
1061
1038
{
1062
1039
const x = new Array ( 101 ) . fill ( ) ;
1063
1040
assert ( util . inspect ( x ) . endsWith ( '1 more item ]' ) ) ;
1064
- }
1065
-
1066
- {
1067
- const x = new Array ( 101 ) . fill ( ) ;
1068
1041
assert ( ! util . inspect ( x , { maxArrayLength : 101 } ) . endsWith ( '1 more item ]' ) ) ;
1069
1042
assert . strictEqual (
1070
1043
util . inspect ( x , { maxArrayLength : - 1 } ) ,
1071
1044
'[ ... 101 more items ]'
1072
1045
) ;
1073
- }
1074
-
1075
- {
1076
- const x = new Array ( 101 ) . fill ( ) ;
1077
1046
assert . strictEqual ( util . inspect ( x , { maxArrayLength : 0 } ) ,
1078
1047
'[ ... 101 more items ]' ) ;
1079
1048
}
@@ -1082,46 +1051,20 @@ if (typeof Symbol !== 'undefined') {
1082
1051
const x = Array ( 101 ) ;
1083
1052
assert . strictEqual ( util . inspect ( x , { maxArrayLength : 0 } ) ,
1084
1053
'[ ... 101 more items ]' ) ;
1085
- }
1086
-
1087
- {
1088
- const x = new Uint8Array ( 101 ) ;
1089
- assert ( util . inspect ( x ) . endsWith ( '1 more item ]' ) ) ;
1090
- }
1091
-
1092
- {
1093
- const x = new Uint8Array ( 101 ) ;
1094
- assert ( ! util . inspect ( x , { maxArrayLength : 101 } ) . endsWith ( '1 more item ]' ) ) ;
1095
- }
1096
-
1097
- {
1098
- const x = new Uint8Array ( 101 ) ;
1099
- assert . strictEqual ( util . inspect ( x , { maxArrayLength : 0 } ) ,
1100
- 'Uint8Array [ ... 101 more items ]' ) ;
1101
- }
1102
-
1103
- {
1104
- const x = Array ( 101 ) ;
1105
1054
assert ( ! util . inspect ( x , { maxArrayLength : null } ) . endsWith ( '1 more item ]' ) ) ;
1106
- }
1107
-
1108
- {
1109
- const x = Array ( 101 ) ;
1110
1055
assert ( ! util . inspect (
1111
1056
x , { maxArrayLength : Infinity }
1112
1057
) . endsWith ( '1 more item ]' ) ) ;
1113
1058
}
1114
1059
1115
1060
{
1116
1061
const x = new Uint8Array ( 101 ) ;
1062
+ assert ( util . inspect ( x ) . endsWith ( '1 more item ]' ) ) ;
1063
+ assert ( ! util . inspect ( x , { maxArrayLength : 101 } ) . endsWith ( '1 more item ]' ) ) ;
1064
+ assert . strictEqual ( util . inspect ( x , { maxArrayLength : 0 } ) ,
1065
+ 'Uint8Array [ ... 101 more items ]' ) ;
1117
1066
assert ( ! util . inspect ( x , { maxArrayLength : null } ) . endsWith ( '1 more item ]' ) ) ;
1118
- }
1119
-
1120
- {
1121
- const x = new Uint8Array ( 101 ) ;
1122
- assert ( ! util . inspect (
1123
- x , { maxArrayLength : Infinity }
1124
- ) . endsWith ( '1 more item ]' ) ) ;
1067
+ assert ( util . inspect ( x , { maxArrayLength : Infinity } ) . endsWith ( ' 0 ]' ) ) ;
1125
1068
}
1126
1069
1127
1070
{
0 commit comments