Browse Source

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>
v5.x
Trevor Norris 9 years ago
committed by Rod Vagg
parent
commit
406eb1f516
  1. 1
      src/async-wrap.cc
  2. 10
      src/env-inl.h
  3. 3
      src/env.cc
  4. 3
      src/env.h
  5. 2
      src/node.cc

1
src/async-wrap.cc

@ -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());
}

10
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;

3
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;
}

3
src/env.h

@ -345,12 +345,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.
@ -364,7 +362,6 @@ class Environment {
uint32_t fields_[kFieldsCount];
bool in_tick_;
bool last_threw_;
DISALLOW_COPY_AND_ASSIGN(TickInfo);
};

2
src/node.cc

@ -1162,7 +1162,7 @@ Local<Value> MakeCallback(Environment* env,
}
}
TryCatch try_catch;
TryCatch try_catch(env->isolate());
try_catch.SetVerbose(true);
if (has_domain) {

Loading…
Cancel
Save