Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 9fc4b9b

Browse filesBrowse files
joyeecheungbengl
authored andcommitted
src: include internal/options in the snapshot
This patch enables internal/options to be included in the snapshot, so that when lazy loading the run time options, the modules only need to make sure that the options are queried lazily and do not have to lazy load the internal/options module together. We can still guarantee that no run time options are serialized into the state-independent bootstrap snapshot with the assertion inside GetCLIOptions(). PR-URL: #42203 Refs: #37476 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent fe01940 commit 9fc4b9b
Copy full SHA for 9fc4b9b

File tree

Expand file treeCollapse file tree

3 files changed

+9
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+9
-0
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ require('fs');
391391
require('v8');
392392
require('vm');
393393
require('url');
394+
require('internal/options');
394395

395396
function setupPrepareStackTrace() {
396397
const {
Collapse file

‎src/node_external_reference.h‎

Copy file name to clipboardExpand all lines: src/node_external_reference.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ class ExternalReferenceRegistry {
6767
V(heap_utils) \
6868
V(messaging) \
6969
V(native_module) \
70+
V(options) \
7071
V(os) \
7172
V(performance) \
7273
V(process_methods) \
Collapse file

‎src/node_options.cc‎

Copy file name to clipboardExpand all lines: src/node_options.cc
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "env-inl.h"
55
#include "node_binding.h"
6+
#include "node_external_reference.h"
67
#include "node_internals.h"
78
#if HAVE_OPENSSL
89
#include "openssl/opensslv.h"
@@ -1132,6 +1133,10 @@ void Initialize(Local<Object> target,
11321133
.Check();
11331134
}
11341135

1136+
void RegisterExternalReferences(ExternalReferenceRegistry* registry) {
1137+
registry->Register(GetCLIOptions);
1138+
registry->Register(GetEmbedderOptions);
1139+
}
11351140
} // namespace options_parser
11361141

11371142
void HandleEnvOptions(std::shared_ptr<EnvironmentOptions> env_options) {
@@ -1198,3 +1203,5 @@ std::vector<std::string> ParseNodeOptionsEnvVar(
11981203
} // namespace node
11991204

12001205
NODE_MODULE_CONTEXT_AWARE_INTERNAL(options, node::options_parser::Initialize)
1206+
NODE_MODULE_EXTERNAL_REFERENCE(options,
1207+
node::options_parser::RegisterExternalReferences)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.