atob and btoa handle Symbol arguments incorrectly
dleviminzi opened ·
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)
bartlomiejureferenced 9c2d299dd6ablast month on GitHub
ryreferenced e519694581dclast month on GitHub
ryreferenced 4250d366aceblast month on GitHub
ryreferenced 3127cf8e307elast month on GitHub
ryreferenced 12d5b6333fe5last month on GitHub