mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/56496 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Bryan English <bryan@bryanenglish.com> Reviewed-By: James M Snell <jasnell@gmail.com>
19 lines
553 B
JavaScript
19 lines
553 B
JavaScript
'use strict';
|
|
|
|
const { mustNotCall, skip, isWindows } = require('../common');
|
|
const { strictEqual } = require('assert');
|
|
const { isMainThread } = require('worker_threads');
|
|
|
|
if (!isMainThread) {
|
|
skip('process.execve is not available in Workers');
|
|
} else if (isWindows) {
|
|
skip('process.execve is not available in Windows');
|
|
}
|
|
|
|
if (process.argv[2] === 'replaced') {
|
|
strictEqual(process.argv[2], 'replaced');
|
|
} else {
|
|
process.on('exit', mustNotCall());
|
|
process.execve(process.execPath, [process.execPath, __filename, 'replaced'], process.env);
|
|
}
|