mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

Enforce `//` for multiline comments. Some tests mixed and matched, and at least one did so in a (to me) surprising way. PR-URL: https://github.com/nodejs/node/pull/35485 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
18 lines
517 B
JavaScript
18 lines
517 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 that passing keyobject 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);
|
|
}
|