PR-URL: https://github.com/nodejs/node/pull/41478 Fixes: https://github.com/nodejs/node/issues/41450 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
14 lines
371 B
JavaScript
14 lines
371 B
JavaScript
'use strict';
|
|
|
|
require('../common');
|
|
|
|
const { strictEqual, throws } = require('assert');
|
|
const buffer = require('buffer');
|
|
|
|
// Exported on the global object
|
|
strictEqual(globalThis.atob, buffer.atob);
|
|
strictEqual(globalThis.btoa, buffer.btoa);
|
|
|
|
// Throws type error on no argument passed
|
|
throws(() => buffer.atob(), /TypeError/);
|
|
throws(() => buffer.btoa(), /TypeError/);
|