mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 21:19:50 +01:00
f543c054fc
PR-URL: https://github.com/nodejs/node/pull/46942 Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
21 lines
434 B
JavaScript
21 lines
434 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
const { Session } = require('inspector');
|
|
const { Worker, isMainThread, workerData } = require('worker_threads');
|
|
|
|
if (!workerData) {
|
|
common.skipIfWorker();
|
|
}
|
|
|
|
if (isMainThread) {
|
|
new Worker(__filename, { workerData: {} });
|
|
} else {
|
|
const session = new Session();
|
|
session.connectToMainThread();
|
|
// Do not crash
|
|
session.disconnect();
|
|
}
|