GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — process: make execve's args argument optional · nodejs/node@74e1aa4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib/internal/process
    • per_thread.js
  • node.gyp
  • test
    • nop
      • nop.c
    • parallel
      • test-process-execve-no-args.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/process/per_thread.js‎

Copy file name to clipboardExpand all lines: lib/internal/process/per_thread.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ function wrapProcessMethods(binding) {
237237
return true;
238238
}
239239

240-
function execve(execPath, args, env) {
240+
function execve(execPath, args = [], env) {
241241
emitExperimentalWarning('process.execve');
242242

243243
const { isMainThread } = require('internal/worker');
Collapse file

‎node.gyp‎

Copy file name to clipboardExpand all lines: node.gyp
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,13 @@
13361336
}],
13371337
]
13381338
}, # overlapped-checker
1339+
{
1340+
'target_name': 'nop',
1341+
'type': 'executable',
1342+
'sources': [
1343+
'test/nop/nop.c',
1344+
]
1345+
}, # nop
13391346
{
13401347
'target_name': 'node_js2c',
13411348
'type': 'executable',
Collapse file

‎test/nop/nop.c‎

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
int main(void) {
2+
return 0;
3+
}
Collapse file

‎test/parallel/test-process-execve-no-args.js‎

Copy file name to clipboard
+25Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
'use strict';
2+
3+
const { skip, isWindows, isIBMi } = require('../common');
4+
const { fail } = require('assert');
5+
const { isMainThread } = require('worker_threads');
6+
const { dirname, join } = require('path');
7+
const { existsSync } = require('fs');
8+
9+
if (!isMainThread) {
10+
skip('process.execve is not available in Workers');
11+
} else if (isWindows || isIBMi) {
12+
skip('process.execve is not available in Windows or IBM i');
13+
}
14+
15+
// Get full path to the executable used for the test
16+
const executable = join(dirname(process.execPath), 'nop');
17+
18+
// Sanity check that the binary exists
19+
if (!existsSync(executable)) {
20+
skip(executable + ' binary is not available');
21+
}
22+
23+
process.execve(executable);
24+
// If process.execve succeeds, this should never be executed.
25+
fail('process.execve failed');

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.