From ed6d0cdd796c7bf602fddcadbd1e2bc990a55be6 Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Thu, 11 Feb 2016 13:10:47 -0700 Subject: [PATCH] src: remove unused of TickInfo::last_threw() Environment::TickInfo::last_threw() is no longer in use. Also pass Isolate to few methods and fix whitespace alignment. Ref: https://github.com/nodejs/node/pull/7048 PR-URL: https://github.com/nodejs/node/pull/4507 Reviewed-By: Fedor Indutny --- src/async-wrap.cc | 5 ++--- src/env-inl.h | 10 +--------- src/env.cc | 3 +-- src/env.h | 3 --- src/node.cc | 10 +++++----- 5 files changed, 9 insertions(+), 22 deletions(-) diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 01dcaf277c1840..789e357c732773 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -173,8 +173,8 @@ void LoadAsyncWrapperInfo(Environment* env) { Local AsyncWrap::MakeCallback(const Local cb, - int argc, - Local* argv) { + int argc, + Local* argv) { CHECK(env()->context() == env()->isolate()->GetCurrentContext()); Local pre_fn = env()->async_hooks_pre_function(); @@ -254,7 +254,6 @@ Local AsyncWrap::MakeCallback(const Local cb, env()->tick_callback_function()->Call(process, 0, nullptr); if (try_catch.HasCaught()) { - tick_info->set_last_threw(true); return Undefined(env()->isolate()); } diff --git a/src/env-inl.h b/src/env-inl.h index eebb68eb463e93..f50ec13732e015 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -118,7 +118,7 @@ inline uint32_t Environment::DomainFlag::count() const { return fields_[kCount]; } -inline Environment::TickInfo::TickInfo() : in_tick_(false), last_threw_(false) { +inline Environment::TickInfo::TickInfo() : in_tick_(false) { for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0; } @@ -139,10 +139,6 @@ inline uint32_t Environment::TickInfo::index() const { return fields_[kIndex]; } -inline bool Environment::TickInfo::last_threw() const { - return last_threw_; -} - inline uint32_t Environment::TickInfo::length() const { return fields_[kLength]; } @@ -155,10 +151,6 @@ inline void Environment::TickInfo::set_index(uint32_t value) { fields_[kIndex] = value; } -inline void Environment::TickInfo::set_last_threw(bool value) { - last_threw_ = value; -} - inline Environment::ArrayBufferAllocatorInfo::ArrayBufferAllocatorInfo() { for (int i = 0; i < kFieldsCount; ++i) fields_[i] = 0; diff --git a/src/env.cc b/src/env.cc index 8fa6e5c43afe06..a9b108c47a49be 100644 --- a/src/env.cc +++ b/src/env.cc @@ -74,12 +74,11 @@ bool Environment::KickNextTick(Environment::AsyncCallbackScope* scope) { } // process nextTicks after call - TryCatch try_catch; + TryCatch try_catch(isolate()); try_catch.SetVerbose(true); tick_callback_function()->Call(process_object(), 0, nullptr); if (try_catch.HasCaught()) { - info->set_last_threw(true); return false; } diff --git a/src/env.h b/src/env.h index 8ae681ff43c86f..5849d7a92107e2 100644 --- a/src/env.h +++ b/src/env.h @@ -332,12 +332,10 @@ class Environment { inline uint32_t* fields(); inline int fields_count() const; inline bool in_tick() const; - inline bool last_threw() const; inline uint32_t index() const; inline uint32_t length() const; inline void set_in_tick(bool value); inline void set_index(uint32_t value); - inline void set_last_threw(bool value); private: friend class Environment; // So we can call the constructor. @@ -351,7 +349,6 @@ class Environment { uint32_t fields_[kFieldsCount]; bool in_tick_; - bool last_threw_; DISALLOW_COPY_AND_ASSIGN(TickInfo); }; diff --git a/src/node.cc b/src/node.cc index ef59a103c30eac..fc39b8399a1ffa 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1119,10 +1119,10 @@ void SetupPromises(const FunctionCallbackInfo& args) { Local MakeCallback(Environment* env, - Local recv, - const Local callback, - int argc, - Local argv[]) { + Local recv, + const Local callback, + int argc, + Local argv[]) { // If you hit this assertion, you forgot to enter the v8::Context first. CHECK_EQ(env->context(), env->isolate()->GetCurrentContext()); @@ -1154,7 +1154,7 @@ Local MakeCallback(Environment* env, } } - TryCatch try_catch; + TryCatch try_catch(env->isolate()); try_catch.SetVerbose(true); if (has_domain) {