Skip to content

Commit

Permalink
src: remove abort_on_uncaught_exception node.cc
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danbev authored and targos committed Sep 9, 2018
1 parent 3666662 commit c3c5141
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,11 @@ inline void Environment::set_trace_sync_io(bool value) {
}

inline bool Environment::abort_on_uncaught_exception() const {
return abort_on_uncaught_exception_;
return options_->abort_on_uncaught_exception;
}

inline void Environment::set_abort_on_uncaught_exception(bool value) {
abort_on_uncaught_exception_ = value;
options_->abort_on_uncaught_exception = value;
}

inline AliasedBuffer<uint32_t, v8::Uint32Array>&
Expand Down
7 changes: 1 addition & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ static node_module* modlist_internal;
static node_module* modlist_linked;
static node_module* modlist_addon;

// TODO(addaleax): This should not be global.
static bool abort_on_uncaught_exception = false;

// Bit flag used to track security reverts (see node_revert.h)
unsigned int reverted = 0;

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

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

env.set_abort_on_uncaught_exception(abort_on_uncaught_exception);

// TODO(addaleax): Maybe access this option directly instead of setting
// a boolean member of Environment. Ditto below for trace_sync_io.
if (env.options()->no_force_async_hooks_checks) {
Expand Down
1 change: 1 addition & 0 deletions src/node_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class DebugOptions {
class EnvironmentOptions {
public:
std::shared_ptr<DebugOptions> debug_options { new DebugOptions() };
bool abort_on_uncaught_exception = false;
bool experimental_modules = false;
bool experimental_repl_await = false;
bool experimental_vm_modules = false;
Expand Down

0 comments on commit c3c5141

Please sign in to comment.