Skip to content

src, test: Move command line arguments into a structure.

CloudABI is a sandboxed runtime environment in which dependencies on resources need to be injected in the form of file descriptors in order to be accessible. To make injection easy, string command line arguments have been replaced by a YAML/JSON-like tree structure that in addition to strings/integers/etc. can hold file descriptors, called Argdata:

https://github.com/NuxiNL/argdata

Adding support for this mechanism to Node.js is currently a bit hard, because many of the startup functions take argc, argv, exec_argc and exec_argv and forward that along. Substituting these arguments with Argdata for CloudABI would make a mess out of the code.

Place the argc, argv, exec_argc and exec_argv in a structure. While there, replace exec_argc and exec_argv with a std::vector<char*>. This removes the need for doing some manual memory management. Give the V8 command line arguments the same treatment.

All in all, the code is now a bit more compact and hopefully considered more readable.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes: There are some tests that fail on my system (a FreeBSD jail), but they also fail without this change
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

src, test

Merge request reports

Loading