Open annevk opened 7 years ago
For btoa() you'd get TypeError instead of "InvalidCharacterError", but the conversion to bytes would happen in the IDL layer, which seems better?
btoa()
The same is true for atob() which effectively returns a byte sequence that the IDL layer can then turn into a string to be exposed to JavaScript.
atob()
(The latter is also useful for an upcoming refactoring that allows us to reuse the atob() algorithm for data URLs.)
If we decide not to do this because we want to keep the exception the same, we should still update the text to make use of https://github.com/whatwg/infra/pull/146.
For
btoa()
you'd get TypeError instead of "InvalidCharacterError", but the conversion to bytes would happen in the IDL layer, which seems better?The same is true for
atob()
which effectively returns a byte sequence that the IDL layer can then turn into a string to be exposed to JavaScript.(The latter is also useful for an upcoming refactoring that allows us to reuse the
atob()
algorithm for data URLs.)