mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
Fixes: https://github.com/nodejs/node/issues/35263 PR-URL: https://github.com/nodejs/node/pull/35416 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>
19 lines
527 B
JavaScript
19 lines
527 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
// Issue https://github.com/nodejs/node/issues/35263
|
|
/* Description: test for checking keyobject passed to worker thread
|
|
does not crash */
|
|
const { createSecretKey } = require('crypto');
|
|
|
|
const { Worker, isMainThread, workerData } = require('worker_threads');
|
|
|
|
if (isMainThread) {
|
|
const key = createSecretKey(Buffer.from('hello'));
|
|
new Worker(__filename, { workerData: key });
|
|
} else {
|
|
console.log(workerData);
|
|
}
|