@@ -143,12 +143,12 @@ for (const showHidden of [true, false]) {
143
143
assert . strictEqual (
144
144
util . inspect ( array , true ) ,
145
145
`${ constructor . name } [\n` +
146
- ` 65,\n` +
147
- ` 97,\n` +
146
+ ' 65,\n' +
147
+ ' 97,\n' +
148
148
` [BYTES_PER_ELEMENT]: ${ constructor . BYTES_PER_ELEMENT } ,\n` +
149
149
` [length]: ${ length } ,\n` +
150
150
` [byteLength]: ${ byteLength } ,\n` +
151
- ` [byteOffset]: 0,\n` +
151
+ ' [byteOffset]: 0,\n' +
152
152
` [buffer]: ArrayBuffer { byteLength: ${ byteLength } } ]` ) ;
153
153
assert . strictEqual (
154
154
util . inspect ( array , false ) ,
@@ -168,23 +168,21 @@ for (const showHidden of [true, false]) {
168
168
Uint8ClampedArray ] . forEach ( ( constructor ) => {
169
169
const length = 2 ;
170
170
const byteLength = length * constructor . BYTES_PER_ELEMENT ;
171
- const array = vm . runInNewContext ( 'new constructor(new ArrayBuffer(' +
172
- 'byteLength), 0, length)' ,
173
- { constructor : constructor ,
174
- byteLength : byteLength ,
175
- length : length
176
- } ) ;
171
+ const array = vm . runInNewContext (
172
+ 'new constructor(new ArrayBuffer(byteLength), 0, length)' ,
173
+ { constructor, byteLength, length }
174
+ ) ;
177
175
array [ 0 ] = 65 ;
178
176
array [ 1 ] = 97 ;
179
177
assert . strictEqual (
180
178
util . inspect ( array , true ) ,
181
179
`${ constructor . name } [\n` +
182
- ` 65,\n` +
183
- ` 97,\n` +
180
+ ' 65,\n' +
181
+ ' 97,\n' +
184
182
` [BYTES_PER_ELEMENT]: ${ constructor . BYTES_PER_ELEMENT } ,\n` +
185
183
` [length]: ${ length } ,\n` +
186
184
` [byteLength]: ${ byteLength } ,\n` +
187
- ` [byteOffset]: 0,\n` +
185
+ ' [byteOffset]: 0,\n' +
188
186
` [buffer]: ArrayBuffer { byteLength: ${ byteLength } } ]` ) ;
189
187
assert . strictEqual (
190
188
util . inspect ( array , false ) ,
@@ -208,8 +206,8 @@ for (const showHidden of [true, false]) {
208
206
// Objects without prototype
209
207
{
210
208
const out = util . inspect ( Object . create ( null ,
211
- { name : { value : 'Tim' , enumerable : true } ,
212
- hidden : { value : 'secret' } } ) , true ) ;
209
+ { name : { value : 'Tim' , enumerable : true } ,
210
+ hidden : { value : 'secret' } } ) , true ) ;
213
211
if ( out !== "{ [hidden]: 'secret', name: 'Tim' }" &&
214
212
out !== "{ name: 'Tim', [hidden]: 'secret' }" ) {
215
213
common . fail ( `unexpected value for out ${ out } ` ) ;
@@ -696,7 +694,14 @@ assert.strictEqual(
696
694
697
695
// test Promise
698
696
assert . strictEqual ( util . inspect ( Promise . resolve ( 3 ) ) , 'Promise { 3 }' ) ;
699
- assert . strictEqual ( util . inspect ( Promise . reject ( 3 ) ) , 'Promise { <rejected> 3 }' ) ;
697
+
698
+ {
699
+ const rejected = Promise . reject ( 3 ) ;
700
+ assert . strictEqual ( util . inspect ( rejected ) , 'Promise { <rejected> 3 }' ) ;
701
+ // squelch UnhandledPromiseRejection
702
+ rejected . catch ( ( ) => { } ) ;
703
+ }
704
+
700
705
assert . strictEqual (
701
706
util . inspect ( new Promise ( function ( ) { } ) ) ,
702
707
'Promise { <pending> }'
@@ -831,7 +836,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
831
836
832
837
{
833
838
const x = Array ( 101 ) ;
834
- assert ( / ^ \[ ... 1 0 1 m o r e i t e m s \ ]$ / . test (
839
+ assert ( / ^ \[ ... 1 0 1 m o r e i t e m s ] $ / . test (
835
840
util . inspect ( x , { maxArrayLength : 0 } ) ) ) ;
836
841
}
837
842
@@ -847,7 +852,7 @@ checkAlignment(new Map(big_array.map(function(y) { return [y, null]; })));
847
852
848
853
{
849
854
const x = new Uint8Array ( 101 ) ;
850
- assert ( / \[ ... 1 0 1 m o r e i t e m s \ ]$ / . test (
855
+ assert ( / \[ ... 1 0 1 m o r e i t e m s ] $ / . test (
851
856
util . inspect ( x , { maxArrayLength : 0 } ) ) ) ;
852
857
}
853
858
0 commit comments