Skip to content

Commit 406eb1f

Browse files
trevnorrisrvagg
authored andcommitted
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: #4507 Reviewed-By: Fedor Indutny <fedor@indutny.com>
1 parent bcec2fe commit 406eb1f

File tree

5 files changed

+9
-22
lines changed

5 files changed

+9
-22
lines changed

src/async-wrap.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ void LoadAsyncWrapperInfo(Environment* env) {
173173

174174

175175
Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
176-
int argc,
177-
Local<Value>* argv) {
176+
int argc,
177+
Local<Value>* argv) {
178178
CHECK(env()->context() == env()->isolate()->GetCurrentContext());
179179

180180
Local<Function> pre_fn = env()->async_hooks_pre_function();
@@ -254,7 +254,6 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb,
254254
env()->tick_callback_function()->Call(process, 0, nullptr);
255255

256256
if (try_catch.HasCaught()) {
257-
tick_info->set_last_threw(true);
258257
return Undefined(env()->isolate());
259258
}
260259

src/env-inl.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ inline uint32_t Environment::DomainFlag::count() const {
118118
return fields_[kCount];
119119
}
120120

121-
inline Environment::TickInfo::TickInfo() : in_tick_(false), last_threw_(false) {
121+
inline Environment::TickInfo::TickInfo() : in_tick_(false) {
122122
for (int i = 0; i < kFieldsCount; ++i)
123123
fields_[i] = 0;
124124
}
@@ -139,10 +139,6 @@ inline uint32_t Environment::TickInfo::index() const {
139139
return fields_[kIndex];
140140
}
141141

142-
inline bool Environment::TickInfo::last_threw() const {
143-
return last_threw_;
144-
}
145-
146142
inline uint32_t Environment::TickInfo::length() const {
147143
return fields_[kLength];
148144
}
@@ -155,10 +151,6 @@ inline void Environment::TickInfo::set_index(uint32_t value) {
155151
fields_[kIndex] = value;
156152
}
157153

158-
inline void Environment::TickInfo::set_last_threw(bool value) {
159-
last_threw_ = value;
160-
}
161-
162154
inline Environment::ArrayBufferAllocatorInfo::ArrayBufferAllocatorInfo() {
163155
for (int i = 0; i < kFieldsCount; ++i)
164156
fields_[i] = 0;

src/env.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,11 @@ bool Environment::KickNextTick(Environment::AsyncCallbackScope* scope) {
8181
}
8282

8383
// process nextTicks after call
84-
TryCatch try_catch;
84+
TryCatch try_catch(isolate());
8585
try_catch.SetVerbose(true);
8686
tick_callback_function()->Call(process_object(), 0, nullptr);
8787

8888
if (try_catch.HasCaught()) {
89-
info->set_last_threw(true);
9089
return false;
9190
}
9291

src/env.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,10 @@ class Environment {
345345
inline uint32_t* fields();
346346
inline int fields_count() const;
347347
inline bool in_tick() const;
348-
inline bool last_threw() const;
349348
inline uint32_t index() const;
350349
inline uint32_t length() const;
351350
inline void set_in_tick(bool value);
352351
inline void set_index(uint32_t value);
353-
inline void set_last_threw(bool value);
354352

355353
private:
356354
friend class Environment; // So we can call the constructor.
@@ -364,7 +362,6 @@ class Environment {
364362

365363
uint32_t fields_[kFieldsCount];
366364
bool in_tick_;
367-
bool last_threw_;
368365

369366
DISALLOW_COPY_AND_ASSIGN(TickInfo);
370367
};

src/node.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,10 +1127,10 @@ void SetupPromises(const FunctionCallbackInfo<Value>& args) {
11271127

11281128

11291129
Local<Value> MakeCallback(Environment* env,
1130-
Local<Value> recv,
1131-
const Local<Function> callback,
1132-
int argc,
1133-
Local<Value> argv[]) {
1130+
Local<Value> recv,
1131+
const Local<Function> callback,
1132+
int argc,
1133+
Local<Value> argv[]) {
11341134
// If you hit this assertion, you forgot to enter the v8::Context first.
11351135
CHECK_EQ(env->context(), env->isolate()->GetCurrentContext());
11361136

@@ -1162,7 +1162,7 @@ Local<Value> MakeCallback(Environment* env,
11621162
}
11631163
}
11641164

1165-
TryCatch try_catch;
1165+
TryCatch try_catch(env->isolate());
11661166
try_catch.SetVerbose(true);
11671167

11681168
if (has_domain) {

0 commit comments

Comments
 (0)