mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
12 lines
344 B
JavaScript
12 lines
344 B
JavaScript
|
'use strict';
|
||
|
const common = require('../common');
|
||
|
const assert = require('assert');
|
||
|
const { Worker } = require('worker_threads');
|
||
|
const dc = require('diagnostics_channel');
|
||
|
|
||
|
dc.subscribe('worker_threads', common.mustCall(({ worker }) => {
|
||
|
assert.strictEqual(worker instanceof Worker, true);
|
||
|
}));
|
||
|
|
||
|
new Worker('const a = 1;', { eval: true });
|