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 0544075

Browse filesBrowse files
mscdexBridgeAR
authored andcommitted
buffer: correct concat() error message
PR-URL: #29198 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 925141f commit 0544075
Copy full SHA for 0544075

File tree

Expand file treeCollapse file tree

2 files changed

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

2 files changed

+3
-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
@@ -525,7 +525,7 @@ Buffer.concat = function concat(list, length) {
525525
// TODO(BridgeAR): This should not be of type ERR_INVALID_ARG_TYPE.
526526
// Instead, find the proper error code for this.
527527
throw new ERR_INVALID_ARG_TYPE(
528-
`list[${i}]`, ['Array', 'Buffer', 'Uint8Array'], list[i]);
528+
`list[${i}]`, ['Buffer', 'Uint8Array'], list[i]);
529529
}
530530
_copy(buf, buffer, pos);
531531
pos += buf.length;
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-buffer-concat.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ assert.strictEqual(flatLongLen.toString(), check);
5959
Buffer.concat(value);
6060
}, {
6161
code: 'ERR_INVALID_ARG_TYPE',
62-
message: 'The "list[0]" argument must be one of type Array, Buffer, ' +
62+
message: 'The "list[0]" argument must be one of type Buffer ' +
6363
`or Uint8Array. Received type ${typeof value[0]}`
6464
});
6565
});
@@ -68,7 +68,7 @@ assert.throws(() => {
6868
Buffer.concat([Buffer.from('hello'), 3]);
6969
}, {
7070
code: 'ERR_INVALID_ARG_TYPE',
71-
message: 'The "list[1]" argument must be one of type Array, Buffer, ' +
71+
message: 'The "list[1]" argument must be one of type Buffer ' +
7272
'or Uint8Array. Received type number'
7373
});
7474

0 commit comments

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