denoland/celldPublic

self-hosted, distributed Durable Objects

atob and btoa handle Symbol arguments incorrectly

DL

Here is another little bug. `atob()` and `btoa()` should throw `TypeError` when given a `Symbol`. On celld 0.4.1, they convert it to the string `"Symbol()"` and try to decode or encode that instead:

```js atob(Symbol()); // Throws InvalidCharacterError instead btoa(Symbol()); // Returns "U3ltYm9sKCk=" — Base64 for "Symbol()" ```

Here is a patch

[0001-Use-Web-IDL-string-conversion-in-atob-and-btoa.patch](https://github.com/user-attachments/files/32133806/0001-Use-Web-IDL-string-conversion-in-atob-and-btoa.patch)

  1. bartlomiejuclosedlast month on GitHub

  2. bartlomiejureferenced 9c2d299dd6ablast month on GitHub

  3. ryreferenced e519694581dclast month on GitHub

  4. ryreferenced 4250d366aceblast month on GitHub

  5. ryreferenced 3127cf8e307elast month on GitHub

  6. ryreferenced 12d5b6333fe5last month on GitHub