@@ -224,7 +224,8 @@ Buffer.from = function from(value, encodingOrOffset, length) {
224224 throw new errors . TypeError (
225225 'ERR_INVALID_ARG_TYPE' ,
226226 'first argument' ,
227- [ 'string' , 'buffer' , 'arrayBuffer' , 'array' , 'array-like object' ]
227+ [ 'string' , 'buffer' , 'arrayBuffer' , 'array' , 'array-like object' ] ,
228+ value
228229 ) ;
229230} ;
230231
@@ -507,7 +508,8 @@ function byteLength(string, encoding) {
507508 }
508509
509510 throw new errors . TypeError (
510- 'ERR_INVALID_ARG_TYPE' , 'string' , [ 'string' , 'buffer' , 'arrayBuffer' ]
511+ 'ERR_INVALID_ARG_TYPE' , 'string' ,
512+ [ 'string' , 'buffer' , 'arrayBuffer' ] , string
511513 ) ;
512514 }
513515
@@ -668,7 +670,8 @@ Buffer.prototype.toString = function toString(encoding, start, end) {
668670Buffer . prototype . equals = function equals ( b ) {
669671 if ( ! isUint8Array ( b ) ) {
670672 throw new errors . TypeError (
671- 'ERR_INVALID_ARG_TYPE' , 'otherBuffer' , [ 'buffer' , 'uint8Array' ]
673+ 'ERR_INVALID_ARG_TYPE' , 'otherBuffer' ,
674+ [ 'buffer' , 'uint8Array' ] , b
672675 ) ;
673676 }
674677 if ( this === b )
@@ -696,7 +699,8 @@ Buffer.prototype.compare = function compare(target,
696699 thisEnd ) {
697700 if ( ! isUint8Array ( target ) ) {
698701 throw new errors . TypeError (
699- 'ERR_INVALID_ARG_TYPE' , 'target' , [ 'buffer' , 'uint8Array' ]
702+ 'ERR_INVALID_ARG_TYPE' , 'target' ,
703+ [ 'buffer' , 'uint8Array' ] , target
700704 ) ;
701705 }
702706 if ( arguments . length === 1 )
@@ -778,7 +782,8 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
778782 }
779783
780784 throw new errors . TypeError (
781- 'ERR_INVALID_ARG_TYPE' , 'val' , [ 'string' , 'buffer' , 'uint8Array' ]
785+ 'ERR_INVALID_ARG_TYPE' , 'value' ,
786+ [ 'string' , 'buffer' , 'uint8Array' ] , val
782787 ) ;
783788}
784789
@@ -847,7 +852,8 @@ Buffer.prototype.fill = function fill(val, start, end, encoding) {
847852 }
848853
849854 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 ) ;
851857 }
852858 var normalizedEncoding = normalizeEncoding ( encoding ) ;
853859 if ( normalizedEncoding === undefined ) {
0 commit comments