FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

buffer: improve Blob constructor error message when passing a string by meixg · Pull Request #42338 · nodejs/node · GitHub

/ node Public

buffer: improve Blob constructor error message when passing a string - #42338

Merged
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
meixg:buffer-blob-err-meixg
Apr 4, 2022
Merged

buffer: improve Blob constructor error message when passing a string#42338
nodejs-github-bot merged 1 commit into
nodejs:masterfrom
meixg:buffer-blob-err-meixg

Conversation

meixg commented Mar 15, 2022

Copy link
Copy Markdown
Member

resolve: #38856

new Blob('nodejs')

before:

TypeError [ERR_INVALID_ARG_TYPE]: The "sources" argument must be an instance of Iterable. Received type string ('nodejs')

after:

TypeError [ERR_INVALID_ARG_TYPE]: The "sources" argument must be a sequence. Received type string ('nodejs')

ref #38856 (comment):

error messages thrown by some browsers:
Chromium: TypeError: Failed to construct 'Blob': The provided value cannot be converted to a sequence.
Firefox: TypeError: Blob constructor: Argument 1 can't be converted to a sequence.
Safari: TypeError: Value is not a sequence

nodejs-github-bot added the needs-ci PRs that need a full CI run. label Mar 15, 2022
aduh95 requested a review from jasnell March 15, 2022 12:06
meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 17, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 17, 2022

Copy link
Copy Markdown
Collaborator

meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 21, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 21, 2022

Copy link
Copy Markdown
Collaborator

meixg added the request-ci Add this label to start a Jenkins CI on a PR. label Mar 21, 2022
github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Mar 21, 2022

Copy link
Copy Markdown
Collaborator

Comment thread lib/internal/blob.js
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);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

definitely better. might be worth indicating a sequence of what tho

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

aduh95 added the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 4, 2022
nodejs-github-bot removed the commit-queue Add this label to land a pull request using GitHub Actions. label Apr 4, 2022
nodejs-github-bot merged commit 46b633f into nodejs:master Apr 4, 2022

Copy link
Copy Markdown
Collaborator

Landed in 46b633f

juanarbol pushed a commit to juanarbol/node that referenced this pull request Apr 5, 2022
resolve: nodejs#38856

PR-URL: nodejs#42338
Fixes: nodejs#38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This was referenced Apr 5, 2022
juanarbol pushed a commit that referenced this pull request Apr 6, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this pull request Apr 6, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
xtx1130 pushed a commit to xtx1130/node that referenced this pull request Apr 25, 2022
resolve: nodejs#38856

PR-URL: nodejs#42338
Fixes: nodejs#38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
juanarbol pushed a commit that referenced this pull request May 31, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
danielleadams pushed a commit that referenced this pull request Jun 27, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jul 11, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
targos pushed a commit that referenced this pull request Jul 31, 2022
resolve: #38856

PR-URL: #42338
Fixes: #38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
guangwong pushed a commit to noslate-project/node that referenced this pull request Oct 10, 2022
resolve: nodejs/node#38856

PR-URL: nodejs/node#42338
Fixes: nodejs/node#38856
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Blob constructor error message when passing a string is misleading

5 participants


Back | FazBrowse Home | New Git URL