From 46b633f44123d827c00977154df13c68c7b181ae Mon Sep 17 00:00:00 2001 From: Xuguang Mei Date: Tue, 5 Apr 2022 03:14:39 +0800 Subject: [PATCH] buffer: improve Blob constructor error message when passing a string resolve: https://github.com/nodejs/node/issues/38856 PR-URL: https://github.com/nodejs/node/pull/42338 Fixes: https://github.com/nodejs/node/issues/38856 Reviewed-By: Antoine du Hamel Reviewed-By: Benjamin Gruenbaum Reviewed-By: James M Snell --- lib/internal/blob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/blob.js b/lib/internal/blob.js index 68b8d6f89e2042..8fee1d91f79448 100644 --- a/lib/internal/blob.js +++ b/lib/internal/blob.js @@ -138,7 +138,7 @@ class Blob { if (sources === null || typeof sources[SymbolIterator] !== 'function' || typeof sources === 'string') { - throw new ERR_INVALID_ARG_TYPE('sources', 'Iterable', sources); + throw new ERR_INVALID_ARG_TYPE('sources', 'a sequence', sources); } validateObject(options, 'options'); let {