mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 07:27:22 +01:00
fe8972a4ff
This enables using `MessagePort`s in different `vm.Context`s, aiding with the isolation that the `vm` module seeks to provide. Refs: https://github.com/ayojs/ayo/pull/111 PR-URL: https://github.com/nodejs/node/pull/26497 Reviewed-By: James M Snell <jasnell@gmail.com>
25 lines
359 B
JavaScript
25 lines
359 B
JavaScript
'use strict';
|
|
|
|
const {
|
|
isMainThread,
|
|
threadId,
|
|
Worker
|
|
} = require('internal/worker');
|
|
|
|
const {
|
|
MessagePort,
|
|
MessageChannel,
|
|
moveMessagePortToContext,
|
|
} = require('internal/worker/io');
|
|
|
|
module.exports = {
|
|
isMainThread,
|
|
MessagePort,
|
|
MessageChannel,
|
|
moveMessagePortToContext,
|
|
threadId,
|
|
Worker,
|
|
parentPort: null,
|
|
workerData: null,
|
|
};
|