Skip to content

Commit c3c5141

Browse files
danbevtargos
authored andcommitted
src: remove abort_on_uncaught_exception node.cc
This commit removes the static variable abort_on_uncaught_exception and adds it to the environment options. PR-URL: #22724 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 3666662 commit c3c5141

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/env-inl.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ inline void Environment::set_trace_sync_io(bool value) {
420420
}
421421

422422
inline bool Environment::abort_on_uncaught_exception() const {
423-
return abort_on_uncaught_exception_;
423+
return options_->abort_on_uncaught_exception;
424424
}
425425

426426
inline void Environment::set_abort_on_uncaught_exception(bool value) {
427-
abort_on_uncaught_exception_ = value;
427+
options_->abort_on_uncaught_exception = value;
428428
}
429429

430430
inline AliasedBuffer<uint32_t, v8::Uint32Array>&

src/node.cc

+1-6
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,6 @@ static node_module* modlist_internal;
183183
static node_module* modlist_linked;
184184
static node_module* modlist_addon;
185185

186-
// TODO(addaleax): This should not be global.
187-
static bool abort_on_uncaught_exception = false;
188-
189186
// Bit flag used to track security reverts (see node_revert.h)
190187
unsigned int reverted = 0;
191188

@@ -2669,7 +2666,7 @@ void ProcessArgv(std::vector<std::string>* args,
26692666
"--abort-on-uncaught-exception") != v8_args.end() ||
26702667
std::find(v8_args.begin(), v8_args.end(),
26712668
"--abort_on_uncaught_exception") != v8_args.end()) {
2672-
abort_on_uncaught_exception = true;
2669+
env_opts->abort_on_uncaught_exception = true;
26732670
}
26742671

26752672
// TODO(bnoordhuis) Intercept --prof arguments and start the CPU profiler
@@ -3044,8 +3041,6 @@ inline int Start(Isolate* isolate, IsolateData* isolate_data,
30443041
return 12; // Signal internal error.
30453042
}
30463043

3047-
env.set_abort_on_uncaught_exception(abort_on_uncaught_exception);
3048-
30493044
// TODO(addaleax): Maybe access this option directly instead of setting
30503045
// a boolean member of Environment. Ditto below for trace_sync_io.
30513046
if (env.options()->no_force_async_hooks_checks) {

src/node_options.h

+1
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class DebugOptions {
6060
class EnvironmentOptions {
6161
public:
6262
std::shared_ptr<DebugOptions> debug_options { new DebugOptions() };
63+
bool abort_on_uncaught_exception = false;
6364
bool experimental_modules = false;
6465
bool experimental_repl_await = false;
6566
bool experimental_vm_modules = false;

0 commit comments

Comments
 (0)