diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 237a1b96922aef..8f5e8d8f1d7ec8 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -391,6 +391,7 @@ require('fs'); require('v8'); require('vm'); require('url'); +require('internal/options'); function setupPrepareStackTrace() { const { diff --git a/src/node_external_reference.h b/src/node_external_reference.h index 347945a7496d5f..c57a01ff39c20e 100644 --- a/src/node_external_reference.h +++ b/src/node_external_reference.h @@ -67,6 +67,7 @@ class ExternalReferenceRegistry { V(heap_utils) \ V(messaging) \ V(native_module) \ + V(options) \ V(os) \ V(performance) \ V(process_methods) \ diff --git a/src/node_options.cc b/src/node_options.cc index ab3b736e07d8e9..4168759910cde5 100644 --- a/src/node_options.cc +++ b/src/node_options.cc @@ -3,6 +3,7 @@ #include "env-inl.h" #include "node_binding.h" +#include "node_external_reference.h" #include "node_internals.h" #if HAVE_OPENSSL #include "openssl/opensslv.h" @@ -1132,6 +1133,10 @@ void Initialize(Local target, .Check(); } +void RegisterExternalReferences(ExternalReferenceRegistry* registry) { + registry->Register(GetCLIOptions); + registry->Register(GetEmbedderOptions); +} } // namespace options_parser void HandleEnvOptions(std::shared_ptr env_options) { @@ -1198,3 +1203,5 @@ std::vector ParseNodeOptionsEnvVar( } // namespace node NODE_MODULE_CONTEXT_AWARE_INTERNAL(options, node::options_parser::Initialize) +NODE_MODULE_EXTERNAL_REFERENCE(options, + node::options_parser::RegisterExternalReferences)