mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 18:15:18 +00:00

For lint exceptions that are universal or near universal for `test/common`, put the exceptions in a config file rather than disabling the ESLint rules at the top of each file. PR-URL: https://github.com/nodejs/node/pull/39358 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
28 lines
604 B
JavaScript
28 lines
604 B
JavaScript
'use strict';
|
|
|
|
if (require.main !== module) {
|
|
const { spawnSync } = require('child_process');
|
|
|
|
function runModuleAs(filename, flags, spawnOptions, role) {
|
|
return spawnSync(process.execPath,
|
|
[...flags, __filename, role, filename], spawnOptions);
|
|
}
|
|
|
|
module.exports = runModuleAs;
|
|
return;
|
|
}
|
|
|
|
const { Worker, isMainThread, workerData } = require('worker_threads');
|
|
|
|
if (isMainThread) {
|
|
if (process.argv[2] === 'worker') {
|
|
new Worker(__filename, {
|
|
workerData: process.argv[3]
|
|
});
|
|
return;
|
|
}
|
|
require(process.argv[3]);
|
|
} else {
|
|
require(workerData);
|
|
}
|