Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 8da9e4d

Browse filesBrowse files
mscdexBridgeAR
authored andcommitted
buffer: correct indexOf() error message
PR-URL: #29217 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent a007fe9 commit 8da9e4d
Copy full SHA for 8da9e4d

File tree

Expand file treeCollapse file tree

4 files changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

4 files changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎lib/buffer.js‎

Copy file name to clipboardExpand all lines: lib/buffer.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
907907
}
908908

909909
throw new ERR_INVALID_ARG_TYPE(
910-
'value', ['string', 'Buffer', 'Uint8Array'], val
910+
'value', ['number', 'string', 'Buffer', 'Uint8Array'], val
911911
);
912912
}
913913

Collapse file

‎test/parallel/test-bootstrap-modules.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-bootstrap-modules.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const expectedModules = new Set([
2222
'Internal Binding native_module',
2323
'Internal Binding options',
2424
'Internal Binding process_methods',
25+
'Internal Binding string_decoder',
2526
'Internal Binding task_queue',
2627
'Internal Binding timers',
2728
'Internal Binding trace_events',
Collapse file

‎test/parallel/test-buffer-includes.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-includes.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ for (let lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
282282
{
283283
code: 'ERR_INVALID_ARG_TYPE',
284284
type: TypeError,
285-
message: 'The "value" argument must be one of type string, ' +
285+
message: 'The "value" argument must be one of type number, string, ' +
286286
`Buffer, or Uint8Array. Received type ${typeof val}`
287287
}
288288
);
Collapse file

‎test/parallel/test-buffer-indexof.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-indexof.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ assert.strictEqual(Buffer.from('aaaaa').indexOf('b', 'ucs2'), -1);
357357
{
358358
code: 'ERR_INVALID_ARG_TYPE',
359359
type: TypeError,
360-
message: 'The "value" argument must be one of type string, ' +
360+
message: 'The "value" argument must be one of type number, string, ' +
361361
`Buffer, or Uint8Array. Received type ${typeof val}`
362362
}
363363
);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.