@@ -136,7 +136,7 @@ function fromObject(obj) {
136
136
}
137
137
138
138
if ( obj == null ) {
139
- throw new TypeError ( 'must start with number, buffer, array or string' ) ;
139
+ throw new TypeError ( 'Must start with number, buffer, array or string' ) ;
140
140
}
141
141
142
142
if ( obj instanceof ArrayBuffer ) {
@@ -164,7 +164,7 @@ function fromObject(obj) {
164
164
return b ;
165
165
}
166
166
167
- throw new TypeError ( 'must start with number, buffer, array or string' ) ;
167
+ throw new TypeError ( 'Must start with number, buffer, array or string' ) ;
168
168
}
169
169
170
170
@@ -217,7 +217,7 @@ Buffer.isEncoding = function(encoding) {
217
217
218
218
Buffer . concat = function ( list , length ) {
219
219
if ( ! Array . isArray ( list ) )
220
- throw new TypeError ( 'list argument must be an Array of Buffers. ' ) ;
220
+ throw new TypeError ( '" list" argument must be an Array of Buffers' ) ;
221
221
222
222
if ( list . length === 0 )
223
223
return new Buffer ( 0 ) ;
@@ -375,7 +375,7 @@ Buffer.prototype.toString = function() {
375
375
var result = slowToString . apply ( this , arguments ) ;
376
376
}
377
377
if ( result === undefined )
378
- throw new Error ( 'toString failed' ) ;
378
+ throw new Error ( '" toString()" failed' ) ;
379
379
return result ;
380
380
} ;
381
381
@@ -462,7 +462,7 @@ Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
462
462
return binding . indexOfNumber ( this , val , byteOffset ) ;
463
463
}
464
464
465
- throw new TypeError ( 'val must be string, number or Buffer' ) ;
465
+ throw new TypeError ( '" val" argument must be string, number or Buffer' ) ;
466
466
} ;
467
467
468
468
@@ -471,7 +471,7 @@ Buffer.prototype.fill = function fill(val, start, end) {
471
471
end = ( end === undefined ) ? this . length : end >> 0 ;
472
472
473
473
if ( start < 0 || end > this . length )
474
- throw new RangeError ( 'out of range index' ) ;
474
+ throw new RangeError ( 'Out of range index' ) ;
475
475
if ( end <= start )
476
476
return this ;
477
477
@@ -493,7 +493,7 @@ Buffer.prototype.fill = function fill(val, start, end) {
493
493
Buffer . prototype . get = internalUtil . deprecate ( function get ( offset ) {
494
494
offset = ~ ~ offset ;
495
495
if ( offset < 0 || offset >= this . length )
496
- throw new RangeError ( 'index out of range' ) ;
496
+ throw new RangeError ( 'Index out of range' ) ;
497
497
return this [ offset ] ;
498
498
} , 'Buffer.get is deprecated. Use array indexes instead.' ) ;
499
499
@@ -502,7 +502,7 @@ Buffer.prototype.get = internalUtil.deprecate(function get(offset) {
502
502
Buffer . prototype . set = internalUtil . deprecate ( function set ( offset , v ) {
503
503
offset = ~ ~ offset ;
504
504
if ( offset < 0 || offset >= this . length )
505
- throw new RangeError ( 'index out of range' ) ;
505
+ throw new RangeError ( 'Index out of range' ) ;
506
506
return this [ offset ] = v ;
507
507
} , 'Buffer.set is deprecated. Use array indexes instead.' ) ;
508
508
@@ -552,7 +552,7 @@ Buffer.prototype.write = function(string, offset, length, encoding) {
552
552
length = remaining ;
553
553
554
554
if ( string . length > 0 && ( length < 0 || offset < 0 ) )
555
- throw new RangeError ( 'attempt to write outside buffer bounds' ) ;
555
+ throw new RangeError ( 'Attempt to write outside buffer bounds' ) ;
556
556
557
557
if ( ! encoding )
558
558
encoding = 'utf8' ;
@@ -612,7 +612,7 @@ Buffer.prototype.slice = function slice(start, end) {
612
612
613
613
function checkOffset ( offset , ext , length ) {
614
614
if ( offset + ext > length )
615
- throw new RangeError ( 'index out of range' ) ;
615
+ throw new RangeError ( 'Index out of range' ) ;
616
616
}
617
617
618
618
@@ -820,11 +820,11 @@ Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
820
820
821
821
function checkInt ( buffer , value , offset , ext , max , min ) {
822
822
if ( ! ( buffer instanceof Buffer ) )
823
- throw new TypeError ( 'buffer must be a Buffer instance' ) ;
823
+ throw new TypeError ( '" buffer" argument must be a Buffer instance' ) ;
824
824
if ( value > max || value < min )
825
- throw new TypeError ( 'value is out of bounds' ) ;
825
+ throw new TypeError ( '" value" argument is out of bounds' ) ;
826
826
if ( offset + ext > buffer . length )
827
- throw new RangeError ( 'index out of range' ) ;
827
+ throw new RangeError ( 'Index out of range' ) ;
828
828
}
829
829
830
830
@@ -1030,9 +1030,9 @@ Buffer.prototype.writeInt32BE = function(value, offset, noAssert) {
1030
1030
1031
1031
function checkFloat ( buffer , value , offset , ext ) {
1032
1032
if ( ! ( buffer instanceof Buffer ) )
1033
- throw new TypeError ( 'buffer must be a Buffer instance' ) ;
1033
+ throw new TypeError ( '" buffer" argument must be a Buffer instance' ) ;
1034
1034
if ( offset + ext > buffer . length )
1035
- throw new RangeError ( 'index out of range' ) ;
1035
+ throw new RangeError ( 'Index out of range' ) ;
1036
1036
}
1037
1037
1038
1038
0 commit comments