@@ -224,7 +224,8 @@ Buffer.from = function from(value, encodingOrOffset, length) {
224
224
throw new errors . TypeError (
225
225
'ERR_INVALID_ARG_TYPE' ,
226
226
'first argument' ,
227
- [ 'string' , 'buffer' , 'arrayBuffer' , 'array' , 'array-like object' ]
227
+ [ 'string' , 'buffer' , 'arrayBuffer' , 'array' , 'array-like object' ] ,
228
+ value
228
229
) ;
229
230
} ;
230
231
@@ -507,7 +508,8 @@ function byteLength(string, encoding) {
507
508
}
508
509
509
510
throw new errors . TypeError (
510
- 'ERR_INVALID_ARG_TYPE' , 'string' , [ 'string' , 'buffer' , 'arrayBuffer' ]
511
+ 'ERR_INVALID_ARG_TYPE' , 'string' ,
512
+ [ 'string' , 'buffer' , 'arrayBuffer' ] , string
511
513
) ;
512
514
}
513
515
@@ -668,7 +670,8 @@ Buffer.prototype.toString = function toString(encoding, start, end) {
668
670
Buffer . prototype . equals = function equals ( b ) {
669
671
if ( ! isUint8Array ( b ) ) {
670
672
throw new errors . TypeError (
671
- 'ERR_INVALID_ARG_TYPE' , 'otherBuffer' , [ 'buffer' , 'uint8Array' ]
673
+ 'ERR_INVALID_ARG_TYPE' , 'otherBuffer' ,
674
+ [ 'buffer' , 'uint8Array' ] , b
672
675
) ;
673
676
}
674
677
if ( this === b )
@@ -696,7 +699,8 @@ Buffer.prototype.compare = function compare(target,
696
699
thisEnd ) {
697
700
if ( ! isUint8Array ( target ) ) {
698
701
throw new errors . TypeError (
699
- 'ERR_INVALID_ARG_TYPE' , 'target' , [ 'buffer' , 'uint8Array' ]
702
+ 'ERR_INVALID_ARG_TYPE' , 'target' ,
703
+ [ 'buffer' , 'uint8Array' ] , target
700
704
) ;
701
705
}
702
706
if ( arguments . length === 1 )
@@ -778,7 +782,8 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
778
782
}
779
783
780
784
throw new errors . TypeError (
781
- 'ERR_INVALID_ARG_TYPE' , 'val' , [ 'string' , 'buffer' , 'uint8Array' ]
785
+ 'ERR_INVALID_ARG_TYPE' , 'value' ,
786
+ [ 'string' , 'buffer' , 'uint8Array' ] , val
782
787
) ;
783
788
}
784
789
@@ -847,7 +852,8 @@ Buffer.prototype.fill = function fill(val, start, end, encoding) {
847
852
}
848
853
849
854
if ( encoding !== undefined && typeof encoding !== 'string' ) {
850
- throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'encoding' , 'string' ) ;
855
+ throw new errors . TypeError ( 'ERR_INVALID_ARG_TYPE' , 'encoding' ,
856
+ 'string' , encoding ) ;
851
857
}
852
858
var normalizedEncoding = normalizeEncoding ( encoding ) ;
853
859
if ( normalizedEncoding === undefined ) {
0 commit comments