src: implement runtime option --no-node-snapshot for debugging by joyeecheung · Pull Request #28567 · nodejs/node · GitHub
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 15 additions & 10 deletions src/node.cc
4 changes: 4 additions & 0 deletions src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,10 @@ PerIsolateOptionsParser::PerIsolateOptionsParser(
"track heap object allocations for heap snapshots",
&PerIsolateOptions::track_heap_objects,
kAllowedInEnvironment);
AddOption("--no-node-snapshot",
"", // It's a debug-only option.
&PerIsolateOptions::no_node_snapshot,
kAllowedInEnvironment);

// Explicitly add some V8 flags to mark them as allowed in NODE_OPTIONS.
AddOption("--abort-on-uncaught-exception",
Expand Down
1 change: 1 addition & 0 deletions src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class PerIsolateOptions : public Options {
public:
std::shared_ptr<EnvironmentOptions> per_env { new EnvironmentOptions() };
bool track_heap_objects = false;
bool no_node_snapshot = false;

#ifdef NODE_REPORT
bool report_uncaught_exception = false;
Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-no-node-snapshot.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict';

// Flags: --no-node-snapshot

require('../common');