Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cast buffer.Blob parts into string as a fallback #37356

Closed
jimmywarting opened this issue Feb 13, 2021 · 0 comments
Closed

Cast buffer.Blob parts into string as a fallback #37356

jimmywarting opened this issue Feb 13, 2021 · 0 comments

Comments

@jimmywarting
Copy link

jimmywarting commented Feb 13, 2021

} else if (!isArrayBufferView(source)) {
throw new ERR_INVALID_ARG_TYPE(
'source',
[
'string',
'ArrayBuffer',
'SharedArrayBuffer',
'Buffer',
'TypedArray',
'DataView'
],
source);
}

it should instead be casted into a string if you don't know how to handle the "blob part" not to throw a error

new window.Blob([null]).text() // "null"
new buffer.Blob([null]) // TypeError [ERR_INVALID_ARG_TYPE]: The "source" argument ...
targos added a commit to targos/node that referenced this issue Feb 16, 2021
targos added a commit to targos/node that referenced this issue Feb 17, 2021
@targos targos closed this as completed in bd4d9ef Feb 17, 2021
targos added a commit that referenced this issue Feb 28, 2021
PR-URL: #37361
Fixes: #37352
Fixes: #37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit to targos/node that referenced this issue Aug 8, 2021
PR-URL: nodejs#37361
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit to targos/node that referenced this issue Aug 8, 2021
PR-URL: nodejs#37361
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit to targos/node that referenced this issue Aug 13, 2021
PR-URL: nodejs#37361
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
targos added a commit that referenced this issue Aug 13, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37352
Fixes: #37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
MylesBorins pushed a commit that referenced this issue Aug 31, 2021
PR-URL: #37361
Backport-PR-URL: #39704
Fixes: #37352
Fixes: #37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
foxxyz pushed a commit to foxxyz/node that referenced this issue Oct 18, 2021
PR-URL: nodejs#37361
Backport-PR-URL: nodejs#39704
Fixes: nodejs#37352
Fixes: nodejs#37356
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant