proposal-arraybuffer-base64
proposal-arraybuffer-base64 copied to clipboard
write data up until error in setFromX methods
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.)