@@ -135,7 +135,7 @@ testBufs('61c8b462c8b563c8b6', 12, 1, 'hex');
135
135
// Make sure this operation doesn't go on forever
136
136
buf1 . fill ( 'yKJh' , 'hex' ) ;
137
137
assert . throws ( ( ) =>
138
- buf1 . fill ( '\u0222' , 'hex' ) , / ^ T y p e E r r o r : I n v a l i d h e x s t r i n g $ / ) ;
138
+ buf1 . fill ( '\u0222' , 'hex' ) , / ^ T y p e E r r o r : I n v a l i d h e x s t r i n g $ / ) ;
139
139
140
140
141
141
// BASE64
@@ -183,23 +183,23 @@ deepStrictEqualValues(genBuffer(4, [hexBufFill, 1, -1]), [0, 0, 0, 0]);
183
183
// Check exceptions
184
184
assert . throws ( ( ) => buf1 . fill ( 0 , - 1 ) , / ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
185
185
assert . throws ( ( ) =>
186
- buf1 . fill ( 0 , 0 , buf1 . length + 1 ) ,
186
+ buf1 . fill ( 0 , 0 , buf1 . length + 1 ) ,
187
187
/ ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
188
188
assert . throws ( ( ) => buf1 . fill ( '' , - 1 ) , / ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
189
189
assert . throws ( ( ) =>
190
- buf1 . fill ( '' , 0 , buf1 . length + 1 ) ,
190
+ buf1 . fill ( '' , 0 , buf1 . length + 1 ) ,
191
191
/ ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
192
192
assert . throws ( ( ) =>
193
- buf1 . fill ( 'a' , 0 , buf1 . length , 'node rocks!' ) ,
193
+ buf1 . fill ( 'a' , 0 , buf1 . length , 'node rocks!' ) ,
194
194
/ ^ T y p e E r r o r : U n k n o w n e n c o d i n g : n o d e r o c k s ! $ / ) ;
195
195
assert . throws ( ( ) =>
196
- buf1 . fill ( 'a' , 0 , 0 , NaN ) ,
196
+ buf1 . fill ( 'a' , 0 , 0 , NaN ) ,
197
197
/ ^ T y p e E r r o r : e n c o d i n g m u s t b e a s t r i n g $ / ) ;
198
198
assert . throws ( ( ) =>
199
- buf1 . fill ( 'a' , 0 , 0 , null ) ,
199
+ buf1 . fill ( 'a' , 0 , 0 , null ) ,
200
200
/ ^ T y p e E r r o r : e n c o d i n g m u s t b e a s t r i n g $ / ) ;
201
201
assert . throws ( ( ) =>
202
- buf1 . fill ( 'a' , 0 , 0 , 'foo' ) , / ^ T y p e E r r o r : U n k n o w n e n c o d i n g : f o o $ / ) ;
202
+ buf1 . fill ( 'a' , 0 , 0 , 'foo' ) , / ^ T y p e E r r o r : U n k n o w n e n c o d i n g : f o o $ / ) ;
203
203
204
204
205
205
function genBuffer ( size , args ) {
@@ -270,10 +270,10 @@ function testBufs(string, offset, length, encoding) {
270
270
271
271
// Make sure these throw.
272
272
assert . throws ( ( ) =>
273
- Buffer . allocUnsafe ( 8 ) . fill ( 'a' , - 1 ) ,
273
+ Buffer . allocUnsafe ( 8 ) . fill ( 'a' , - 1 ) ,
274
274
/ ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
275
275
assert . throws ( ( ) =>
276
- Buffer . allocUnsafe ( 8 ) . fill ( 'a' , 0 , 9 ) ,
276
+ Buffer . allocUnsafe ( 8 ) . fill ( 'a' , 0 , 9 ) ,
277
277
/ ^ R a n g e E r r o r : O u t o f r a n g e i n d e x $ / ) ;
278
278
279
279
// Make sure this doesn't hang indefinitely.
@@ -396,36 +396,36 @@ assert.throws(() => {
396
396
} , / ^ R a n g e E r r o r : o u t o f r a n g e i n d e x $ / ) ;
397
397
398
398
assert . deepStrictEqual (
399
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'ab' , 'utf16le' ) ,
400
- Buffer . from ( '61006200610062006100620061006200' , 'hex' ) ) ;
399
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'ab' , 'utf16le' ) ,
400
+ Buffer . from ( '61006200610062006100620061006200' , 'hex' ) ) ;
401
401
402
402
assert . deepStrictEqual (
403
- Buffer . allocUnsafeSlow ( 15 ) . fill ( 'ab' , 'utf16le' ) ,
404
- Buffer . from ( '610062006100620061006200610062' , 'hex' ) ) ;
403
+ Buffer . allocUnsafeSlow ( 15 ) . fill ( 'ab' , 'utf16le' ) ,
404
+ Buffer . from ( '610062006100620061006200610062' , 'hex' ) ) ;
405
405
406
406
assert . deepStrictEqual (
407
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'ab' , 'utf16le' ) ,
408
- Buffer . from ( '61006200610062006100620061006200' , 'hex' ) ) ;
407
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'ab' , 'utf16le' ) ,
408
+ Buffer . from ( '61006200610062006100620061006200' , 'hex' ) ) ;
409
409
assert . deepStrictEqual (
410
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf16le' ) ,
411
- Buffer . from ( '61006100610061006100610061006100' , 'hex' ) ) ;
410
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf16le' ) ,
411
+ Buffer . from ( '61006100610061006100610061006100' , 'hex' ) ) ;
412
412
413
413
assert . strictEqual (
414
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf16le' ) . toString ( 'utf16le' ) ,
415
- 'a' . repeat ( 8 ) ) ;
414
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf16le' ) . toString ( 'utf16le' ) ,
415
+ 'a' . repeat ( 8 ) ) ;
416
416
assert . strictEqual (
417
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'latin1' ) . toString ( 'latin1' ) ,
418
- 'a' . repeat ( 16 ) ) ;
417
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'latin1' ) . toString ( 'latin1' ) ,
418
+ 'a' . repeat ( 16 ) ) ;
419
419
assert . strictEqual (
420
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf8' ) . toString ( 'utf8' ) ,
421
- 'a' . repeat ( 16 ) ) ;
420
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'a' , 'utf8' ) . toString ( 'utf8' ) ,
421
+ 'a' . repeat ( 16 ) ) ;
422
422
423
423
assert . strictEqual (
424
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'utf16le' ) . toString ( 'utf16le' ) ,
425
- 'Љ' . repeat ( 8 ) ) ;
424
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'utf16le' ) . toString ( 'utf16le' ) ,
425
+ 'Љ' . repeat ( 8 ) ) ;
426
426
assert . strictEqual (
427
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'latin1' ) . toString ( 'latin1' ) ,
428
- '\t' . repeat ( 16 ) ) ;
427
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'latin1' ) . toString ( 'latin1' ) ,
428
+ '\t' . repeat ( 16 ) ) ;
429
429
assert . strictEqual (
430
- Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'utf8' ) . toString ( 'utf8' ) ,
431
- 'Љ' . repeat ( 8 ) ) ;
430
+ Buffer . allocUnsafeSlow ( 16 ) . fill ( 'Љ' , 'utf8' ) . toString ( 'utf8' ) ,
431
+ 'Љ' . repeat ( 8 ) ) ;
0 commit comments