diff options
author | Xuguang Mei <meixg@foxmail.com> | 2022-04-05 03:14:39 +0800 |
---|---|---|
committer | Juan José Arboleda <soyjuanarbol@gmail.com> | 2022-04-06 12:25:55 -0500 |
commit | eb3dfc00f0bf99c873e934c586790b9497c55914 (patch) | |
tree | a35dcd0333102bfaa216a33878b80175514a1483 | |
parent | d64c4fb94ddc05c47bf824389eeef23bb5cee5a4 (diff) | |
download | node-new-eb3dfc00f0bf99c873e934c586790b9497c55914.tar.gz |
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 <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r-- | lib/internal/blob.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/internal/blob.js b/lib/internal/blob.js index d35a461566..aebd2230b5 100644 --- a/lib/internal/blob.js +++ b/lib/internal/blob.js @@ -139,7 +139,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 { |