proposal-arraybuffer-base64 icon indicating copy to clipboard operation
proposal-arraybuffer-base64 copied to clipboard

write data up until error in setFromX methods

Open bakkot opened this issue 1 year ago • 0 comments

Fixes https://github.com/tc39/proposal-arraybuffer-base64/issues/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.)

bakkot avatar Apr 15 '24 04:04 bakkot