mirror of
https://github.com/nodejs/node.git
synced 2026-10-14 10:26:26 -04:00
buffer: fix concat error message
The list argument may only be of type array, not of any other type as it actually suggests. PR-URL: https://github.com/nodejs/node/pull/27050 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
This commit is contained in:
2 files changed
+3
-4
No files matched your search
+1
-2
@@ -432,8 +432,7 @@ Buffer[kIsEncodingSymbol] = Buffer.isEncoding;
|
||||
Buffer.concat = function concat(list, length) {
|
||||
let i;
|
||||
if (!Array.isArray(list)) {
|
||||
throw new ERR_INVALID_ARG_TYPE(
|
||||
'list', ['Array', 'Buffer', 'Uint8Array'], list);
|
||||
throw new ERR_INVALID_ARG_TYPE('list', 'Array', list);
|
||||
}
|
||||
|
||||
if (list.length === 0)
|
||||
|
||||
Reference in new issue
Block a user