Skip to content

Add support for atob() and btoa() functions #1178

@jonkoops

Description

@jonkoops

Problem

Much of the existing code in the JavaScript ecosystem, such as packages on NPM contain code that uses the atob() and btoa() global functions. And although not strictly part of the ECMAScript specification, it might be worthwhile to support these for the sake of compatibility with the rest of the ecosystem. Other runtimes that are also not strictly web-based such as Node.js, Bun and Deno all support these functions as well.

Solution

Add support for the atob() and btoa() global functions to Hermes.

Additional Context

I contribute to jwt-decode, a popular library (~5.7 million downloads per week) to decode JSON Web Tokens. One of the users logged an issue specifically referencing this issue in React Native, and by extension Hermes (see auth0/jwt-decode#241).

Metadata

Metadata

Assignees

No one assigned

    Labels

    community-support-neededFacebook can't provide direct support for this issue, it is up to the communityenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions