Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
buffer: correct indexOf() error message
PR-URL: #29217
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
  • Loading branch information
mscdex committed Aug 28, 2019
commit 5dc5cfba7d4feadc3358d17f974858726e00593f
2 changes: 1 addition & 1 deletion lib/buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}

Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-bootstrap-modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-includes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}
);
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-buffer-indexof.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
}
);
Expand Down