mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 20:29:36 +00:00

PR-URL: https://github.com/nodejs/node/pull/45817 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: James M Snell <jasnell@gmail.com>
12 lines
278 B
JavaScript
12 lines
278 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
const { getRandomValues } = globalThis.crypto;
|
|
|
|
assert.throws(() => getRandomValues(new Uint8Array()), { code: 'ERR_INVALID_THIS' });
|