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

write data up until error in setFromX methods #58

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bakkot
Copy link
Collaborator

@bakkot bakkot commented Apr 15, 2024

Fixes #57.

One difficulty is that in the case of an error there's no good way to know how many bytes were read/written. I don't think that's a problem we need to solve; in practice you are unlikely to have any way to recover in the case of an error, so you're just going to throw the buffer away.

(It would be nice for SyntaxErrors to have a standardized .offset property which told you where the error was, not just for this but also JSON.parse etc. But that's unlikely to be in this proposal.)

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 this pull request may close these issues.

performance of Uint8Array.prototype.setFrom{Base64,Hex}
1 participant