buffer: correct indexOf() error message
PR-URL: https://github.com/nodejs/node/pull/29217 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
bb1af6c82f
commit
5dc5cfba7d
@ -907,7 +907,7 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
|
||||
}
|
||||
|
||||
throw new ERR_INVALID_ARG_TYPE(
|
||||
'value', ['string', 'Buffer', 'Uint8Array'], val
|
||||
'value', ['number', 'string', 'Buffer', 'Uint8Array'], val
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@ const expectedModules = new Set([
|
||||
'Internal Binding native_module',
|
||||
'Internal Binding options',
|
||||
'Internal Binding process_methods',
|
||||
'Internal Binding string_decoder',
|
||||
'Internal Binding task_queue',
|
||||
'Internal Binding timers',
|
||||
'Internal Binding trace_events',
|
||||
|
@ -282,7 +282,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
|
||||
{
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
type: TypeError,
|
||||
message: 'The "value" argument must be one of type string, ' +
|
||||
message: 'The "value" argument must be one of type number, string, ' +
|
||||
`Buffer, or Uint8Array. Received type ${typeof val}`
|
||||
}
|
||||
);
|
||||
|
@ -357,7 +357,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1);
|
||||
{
|
||||
code: 'ERR_INVALID_ARG_TYPE',
|
||||
type: TypeError,
|
||||
message: 'The "value" argument must be one of type string, ' +
|
||||
message: 'The "value" argument must be one of type number, string, ' +
|
||||
`Buffer, or Uint8Array. Received type ${typeof val}`
|
||||
}
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user