mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/60845 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
20 lines
625 B
JavaScript
20 lines
625 B
JavaScript
// Flags: --permission --allow-fs-read=* --allow-child-process
|
|
|
|
'use strict';
|
|
|
|
const { skip, isWindows, isIBMi } = require('../common');
|
|
const assert = require('assert');
|
|
const { isMainThread } = require('worker_threads');
|
|
|
|
if (!isMainThread) {
|
|
skip('process.execve is not available in Workers');
|
|
} else if (isWindows || isIBMi) {
|
|
skip('process.execve is not available in Windows or IBM i');
|
|
}
|
|
|
|
if (process.argv[2] === 'replaced') {
|
|
assert.deepStrictEqual(process.argv, [process.execPath, __filename, 'replaced']);
|
|
} else {
|
|
process.execve(process.execPath, [process.execPath, __filename, 'replaced'], process.env);
|
|
}
|