2022-02-26 18:12:48 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
if (!common.hasCrypto)
|
|
|
|
common.skip('missing crypto');
|
|
|
|
|
|
|
|
const assert = require('assert');
|
2022-12-16 20:55:42 +01:00
|
|
|
const { getRandomValues } = globalThis.crypto;
|
2022-02-26 18:12:48 +01:00
|
|
|
|
|
|
|
assert.throws(() => getRandomValues(new Uint8Array()), { code: 'ERR_INVALID_THIS' });
|