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 — sea: avoid dangling CLI option pointers · nodejs/node@f32a863

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_sea.cc
  • test
    • fixtures/sea/exec-argv-extension-cli
      • sea-config.json
      • sea.js
    • sea
      • test-single-executable-application-exec-argv-extension-cli.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_sea.cc‎

Copy file name to clipboardExpand all lines: src/node_sea.cc
+3-2Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,11 @@ std::tuple<int, char**> FixupArgsForSEA(int argc,
325325
cli_extension_args.size() + 2);
326326
new_argv.emplace_back(argv[0]);
327327

328+
exec_argv_storage.reserve(sea_resource.exec_argv.size() +
329+
cli_extension_args.size());
330+
328331
// Insert exec argv from SEA config
329332
if (!sea_resource.exec_argv.empty()) {
330-
exec_argv_storage.reserve(sea_resource.exec_argv.size() +
331-
cli_extension_args.size());
332333
for (const auto& arg : sea_resource.exec_argv) {
333334
exec_argv_storage.emplace_back(arg);
334335
new_argv.emplace_back(exec_argv_storage.back().data());
Collapse file

‎test/fixtures/sea/exec-argv-extension-cli/sea-config.json‎

Copy file name to clipboardExpand all lines: test/fixtures/sea/exec-argv-extension-cli/sea-config.json
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22
"main": "sea.js",
33
"output": "sea-prep.blob",
44
"disableExperimentalSEAWarning": true,
5-
"execArgv": ["--no-warnings"],
65
"execArgvExtension": "cli"
76
}
Collapse file

‎test/fixtures/sea/exec-argv-extension-cli/sea.js‎

Copy file name to clipboardExpand all lines: test/fixtures/sea/exec-argv-extension-cli/sea.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const assert = require('assert');
33
console.log('process.argv:', JSON.stringify(process.argv));
44
console.log('process.execArgv:', JSON.stringify(process.execArgv));
55

6-
// Should have execArgv from SEA config + CLI --node-options
6+
// Should have all options from CLI --node-options
77
assert.deepStrictEqual(process.execArgv, ['--no-warnings', '--max-old-space-size=1024']);
88

99
assert.deepStrictEqual(process.argv.slice(2), [
Collapse file

‎test/sea/test-single-executable-application-exec-argv-extension-cli.js‎

Copy file name to clipboardExpand all lines: test/sea/test-single-executable-application-exec-argv-extension-cli.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ const env = {
3030
// Test that --node-options works with execArgvExtension: "cli"
3131
spawnSyncAndAssert(
3232
outputFile,
33-
['--node-options=--max-old-space-size=1024', 'user-arg1', 'user-arg2'],
33+
[
34+
'--node-options=--no-warnings --max-old-space-size=1024',
35+
'user-arg1',
36+
'user-arg2',
37+
],
3438
{
3539
env,
3640
},

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.