diff options
author | Trevor Norris <trev.norris@gmail.com> | 2016-02-11 13:10:47 -0700 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2016-02-12 14:03:26 -0700 |
commit | f86a3a2fb567c226d0849c9c8a69118f97578528 (patch) | |
tree | 9b97f178826c28e32f5648fe86835d5b1133f0c0 /src | |
parent | e9192249c8c6b05c7cc04e8b51a7e37235f31415 (diff) | |
download | node-new-f86a3a2fb567c226d0849c9c8a69118f97578528.tar.gz |
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.
PR-URL: https://github.com/nodejs/node/pull/4507
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/async-wrap.cc | 5 | ||||
-rw-r--r-- | src/env-inl.h | 10 | ||||
-rw-r--r-- | src/env.cc | 3 | ||||
-rw-r--r-- | src/env.h | 3 | ||||
-rw-r--r-- | src/node.cc | 10 |
5 files changed, 9 insertions, 22 deletions
diff --git a/src/async-wrap.cc b/src/async-wrap.cc index 01dcaf277c..789e357c73 100644 --- a/src/async-wrap.cc +++ b/src/async-wrap.cc @@ -173,8 +173,8 @@ void LoadAsyncWrapperInfo(Environment* env) { Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, - int argc, - Local<Value>* argv) { + int argc, + Local<Value>* argv) { CHECK(env()->context() == env()->isolate()->GetCurrentContext()); Local<Function> pre_fn = env()->async_hooks_pre_function(); @@ -254,7 +254,6 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> 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 c09fb87897..423002debb 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -131,7 +131,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; } @@ -152,10 +152,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]; } @@ -168,10 +164,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 b852a630d5..b79fe965aa 100644 --- a/src/env.cc +++ b/src/env.cc @@ -81,12 +81,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; } @@ -352,12 +352,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. @@ -371,7 +369,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 d9d27f7a7a..cae4da12c9 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1127,10 +1127,10 @@ void SetupPromises(const FunctionCallbackInfo<Value>& args) { Local<Value> MakeCallback(Environment* env, - Local<Value> recv, - const Local<Function> callback, - int argc, - Local<Value> argv[]) { + Local<Value> recv, + const Local<Function> callback, + int argc, + Local<Value> argv[]) { // If you hit this assertion, you forgot to enter the v8::Context first. CHECK_EQ(env->context(), env->isolate()->GetCurrentContext()); @@ -1162,7 +1162,7 @@ Local<Value> MakeCallback(Environment* env, } } - TryCatch try_catch; + TryCatch try_catch(env->isolate()); try_catch.SetVerbose(true); if (has_domain) { |