Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
buffer: expose btoa and atob as globals
Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: #37786 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Michaël Zasso <targos@protonmail.com>
- Loading branch information
Showing
with
67 additions
and 6 deletions.
- +2 −0 .eslintrc.js
- +4 −0 doc/api/buffer.md
- +20 −0 doc/api/globals.md
- +25 −6 lib/internal/bootstrap/node.js
- +7 −0 test/common/index.js
- +9 −0 test/parallel/test-btoa-atob-global.js
| @@ -0,0 +1,9 @@ | ||
| 'use strict'; | ||
|
|
||
| require('../common'); | ||
|
|
||
| const { strictEqual } = require('assert'); | ||
| const buffer = require('buffer'); | ||
|
|
||
| strictEqual(globalThis.atob, buffer.atob); | ||
| strictEqual(globalThis.btoa, buffer.btoa); |

