mirror of
https://github.com/nodejs/node.git
synced 2024-11-25 08:19:38 +01:00
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();
|
||
|
}
|