Skip to content

Commit

Permalink
src: add missing option parser template for the DebugOptionsParser
Browse files Browse the repository at this point in the history
This allows embedders to run `node::options_parser::Parse` for a
`node::DebugOptions`.

PR-URL: nodejs#28543
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Eugene Ostroukhov <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
MarshallOfSound authored and addaleax committed Jul 14, 2019
1 parent 88bac02 commit 056b0bd
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,17 @@ class PerProcessOptionsParser : public OptionsParser<PerProcessOptions> {
#if HAVE_INSPECTOR
const DebugOptionsParser _dop_instance{};
const EnvironmentOptionsParser _eop_instance{_dop_instance};

// This Parse is not dead code. It is used by embedders (e.g., Electron).
template <>
void Parse(
StringVector* const args, StringVector* const exec_args,
StringVector* const v8_args,
DebugOptions* const options,
OptionEnvvarSettings required_env_settings, StringVector* const errors) {
_dop_instance.Parse(
args, exec_args, v8_args, options, required_env_settings, errors);
}
#else
const EnvironmentOptionsParser _eop_instance{};
#endif // HAVE_INSPECTOR
Expand Down

0 comments on commit 056b0bd

Please sign in to comment.