Skip to content

Commit

Permalink
src: remove tick_info->has_thrown
Browse files Browse the repository at this point in the history
This is no longer necessary in the only place it was used (timers).

PR-URL: #20894
Fixes: #10154
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ben Noordhuis <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Jeremiah Senkpiel <[email protected]>
Reviewed-By: Tiancheng "Timothy" Gu <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
  • Loading branch information
apapirovski committed Jun 25, 2018
1 parent 2930bd1 commit bfcf5b0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/callback_scope.cc
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ InternalCallbackScope::InternalCallbackScope(Environment* env,
AsyncWrap::EmitBefore(env, asyncContext.async_id);
}

if (!IsInnerMakeCallback()) {
env->tick_info()->set_has_thrown(false);
}

env->async_hooks()->push_async_ids(async_context_.async_id,
async_context_.trigger_async_id);
pushed_ids_ = true;
Expand Down Expand Up @@ -118,7 +114,6 @@ void InternalCallbackScope::Close() {
if (!env_->can_call_into_js()) return;

if (env_->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) {
env_->tick_info()->set_has_thrown(true);
failed_ = true;
}
}
Expand Down
8 changes: 0 additions & 8 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@ inline bool Environment::TickInfo::has_scheduled() const {
return fields_[kHasScheduled] == 1;
}

inline bool Environment::TickInfo::has_thrown() const {
return fields_[kHasThrown] == 1;
}

inline bool Environment::TickInfo::has_promise_rejections() const {
return fields_[kHasPromiseRejections] == 1;
}
Expand All @@ -281,10 +277,6 @@ inline void Environment::TickInfo::promise_rejections_toggle_on() {
fields_[kHasPromiseRejections] = 1;
}

inline void Environment::TickInfo::set_has_thrown(bool state) {
fields_[kHasThrown] = state ? 1 : 0;
}

inline void Environment::AssignToContext(v8::Local<v8::Context> context,
const ContextInfo& info) {
context->SetAlignedPointerInEmbedderData(
Expand Down
3 changes: 0 additions & 3 deletions src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -551,10 +551,8 @@ class Environment {
inline AliasedBuffer<uint8_t, v8::Uint8Array>& fields();
inline bool has_scheduled() const;
inline bool has_promise_rejections() const;
inline bool has_thrown() const;

inline void promise_rejections_toggle_on();
inline void set_has_thrown(bool state);

private:
friend class Environment; // So we can call the constructor.
Expand All @@ -563,7 +561,6 @@ class Environment {
enum Fields {
kHasScheduled,
kHasPromiseRejections,
kHasThrown,
kFieldsCount
};

Expand Down

0 comments on commit bfcf5b0

Please sign in to comment.