2023-03-15 07:27:27 +08:00
|
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
|
|
|
|
|
|
common.skipIfInspectorDisabled();
|
|
|
|
|
|
|
|
const { Session } = require('inspector');
|
|
|
|
const { Worker, isMainThread, workerData } = require('worker_threads');
|
|
|
|
|
2025-01-22 14:19:38 -08:00
|
|
|
if (!workerData && !isMainThread) {
|
|
|
|
common.skip('This test only works on a main thread');
|
2023-03-15 07:27:27 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if (isMainThread) {
|
|
|
|
new Worker(__filename, { workerData: {} });
|
|
|
|
} else {
|
|
|
|
const session = new Session();
|
|
|
|
session.connectToMainThread();
|
|
|
|
// Do not crash
|
|
|
|
session.disconnect();
|
|
|
|
}
|