diff options
author | Gus Caplan <me@gus.host> | 2018-11-30 08:13:45 -0600 |
---|---|---|
committer | Gus Caplan <me@gus.host> | 2018-12-03 10:25:06 -0600 |
commit | f084e06de7b03750a80925a7aa1aefe3aed47504 (patch) | |
tree | a014956efe76cd2c1273811eb5efd4d30f784b94 /src/env.cc | |
parent | dbdc9081fa723f62126ef857ee9365425e41dd9f (diff) | |
download | android-node-v8-f084e06de7b03750a80925a7aa1aefe3aed47504.tar.gz android-node-v8-f084e06de7b03750a80925a7aa1aefe3aed47504.tar.bz2 android-node-v8-f084e06de7b03750a80925a7aa1aefe3aed47504.zip |
src: use custom TryCatch subclass
PR-URL: https://github.com/nodejs/node/pull/24751
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/env.cc b/src/env.cc index 5731bad993..bdb3c1ea24 100644 --- a/src/env.cc +++ b/src/env.cc @@ -1,6 +1,7 @@ #include "async_wrap.h" #include "node_buffer.h" #include "node_context_data.h" +#include "node_errors.h" #include "node_file.h" #include "node_internals.h" #include "node_native_module.h" @@ -15,6 +16,7 @@ namespace node { +using errors::TryCatchScope; using v8::Context; using v8::EmbedderGraph; using v8::External; @@ -36,7 +38,6 @@ using v8::StackTrace; using v8::String; using v8::Symbol; using v8::TracingController; -using v8::TryCatch; using v8::Undefined; using v8::Value; using worker::Worker; @@ -156,7 +157,7 @@ void Environment::TrackingTraceStateObserver::UpdateTraceCategoryState() { Local<Function> cb = env_->trace_category_state_function(); if (cb.IsEmpty()) return; - TryCatch try_catch(isolate); + TryCatchScope try_catch(env_); try_catch.SetVerbose(true); cb->Call(env_->context(), Undefined(isolate), 0, nullptr).ToLocalChecked(); @@ -577,7 +578,7 @@ void Environment::RunAndClearNativeImmediates() { std::vector<NativeImmediateCallback> list; native_immediate_callbacks_.swap(list); auto drain_list = [&]() { - TryCatch try_catch(isolate()); + TryCatchScope try_catch(this); for (auto it = list.begin(); it != list.end(); ++it) { #ifdef DEBUG v8::SealHandleScope seal_handle_scope(isolate()); @@ -642,7 +643,7 @@ void Environment::RunTimers(uv_timer_t* handle) { // impossible for us to end up in an infinite loop due to how the JS-side // is structured. do { - TryCatch try_catch(env->isolate()); + TryCatchScope try_catch(env); try_catch.SetVerbose(true); ret = cb->Call(env->context(), process, 1, &arg); } while (ret.IsEmpty() && env->can_call_into_js()); |