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@2ba7406

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
@@ -308,10 +308,11 @@ std::tuple<int, char**> FixupArgsForSEA(int argc, char** argv) {
308308
cli_extension_args.size() + 2);
309309
new_argv.emplace_back(argv[0]);
310310

311+
exec_argv_storage.reserve(sea_resource.exec_argv.size() +
312+
cli_extension_args.size());
313+
311314
// Insert exec argv from SEA config
312315
if (!sea_resource.exec_argv.empty()) {
313-
exec_argv_storage.reserve(sea_resource.exec_argv.size() +
314-
cli_extension_args.size());
315316
for (const auto& arg : sea_resource.exec_argv) {
316317
exec_argv_storage.emplace_back(arg);
317318
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
@@ -23,7 +23,11 @@ const outputFile = generateSEA(fixtures.path('sea', 'exec-argv-extension-cli'));
2323
// Test that --node-options works with execArgvExtension: "cli"
2424
spawnSyncAndAssert(
2525
outputFile,
26-
['--node-options=--max-old-space-size=1024', 'user-arg1', 'user-arg2'],
26+
[
27+
'--node-options=--no-warnings --max-old-space-size=1024',
28+
'user-arg1',
29+
'user-arg2',
30+
],
2731
{
2832
env: {
2933
...process.env,

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.