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: fix omitting `--` from `process.execArgv` · nodejs/node@effe307

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_options-inl.h
  • test/parallel
    • test-process-exec-argv.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_options-inl.h‎

Copy file name to clipboardExpand all lines: src/node_options-inl.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ struct ArgsInfo {
253253
// on the command line (i.e. not generated through alias expansion).
254254
// '--' is a special case here since its purpose is to end `exec_argv`,
255255
// which is why we do not include it.
256-
if (exec_args != nullptr && first() != "--")
256+
if (exec_args != nullptr && ret != "--")
257257
exec_args->push_back(ret);
258258
underlying->erase(underlying->begin() + 1);
259259
} else {
Collapse file

‎test/parallel/test-process-exec-argv.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-process-exec-argv.js
+13-10Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,19 @@ const spawn = require('child_process').spawn;
2727
if (process.argv[2] === 'child') {
2828
process.stdout.write(JSON.stringify(process.execArgv));
2929
} else {
30-
const execArgv = ['--stack-size=256'];
31-
const args = [__filename, 'child', 'arg0'];
32-
const child = spawn(process.execPath, execArgv.concat(args));
33-
let out = '';
30+
for (const extra of [ [], [ '--' ] ]) {
31+
const execArgv = ['--stack-size=256'];
32+
const args = [__filename, 'child', 'arg0'];
33+
const child = spawn(process.execPath, [...execArgv, ...extra, ...args]);
34+
let out = '';
3435

35-
child.stdout.on('data', function(chunk) {
36-
out += chunk;
37-
});
36+
child.stdout.setEncoding('utf8');
37+
child.stdout.on('data', function(chunk) {
38+
out += chunk;
39+
});
3840

39-
child.on('close', function() {
40-
assert.deepStrictEqual(JSON.parse(out), execArgv);
41-
});
41+
child.on('close', function() {
42+
assert.deepStrictEqual(JSON.parse(out), execArgv);
43+
});
44+
}
4245
}

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.