First commit

This commit is contained in:
2025-12-25 11:03:04 +01:00
commit 2991a39094
27 changed files with 1513 additions and 0 deletions

13
test-worker.js Normal file
View File

@@ -0,0 +1,13 @@
'use strict';
const common = require('../../common');
const assert = require('assert');
const path = require('path');
const { Worker } = require('worker_threads');
const binding = path.resolve(__dirname, `./build/${common.buildType}/binding`);
const w = new Worker(`
require('worker_threads').parentPort.postMessage(
require(${JSON.stringify(binding)}).hello());`, { eval: true });
w.on('message', common.mustCall((message) => {
assert.strictEqual(message, 'world');
}));