| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8fa0b5c commit f1488bb
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -181,7 +181,6 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, | |||
| 181 | 181 | Local<Function> post_fn = env()->async_hooks_post_function(); | |
| 182 | 182 | Local<Value> uid = Integer::New(env()->isolate(), get_uid()); | |
| 183 | 183 | Local<Object> context = object(); | |
| 184 | - Local<Object> process = env()->process_object(); | ||
| 185 | 184 | Local<Object> domain; | |
| 186 | 185 | bool has_domain = false; | |
| 187 | 186 | ||
@@ -233,16 +232,18 @@ Local<Value> AsyncWrap::MakeCallback(const Local<Function> cb, | |||
| 233 | 232 | } | |
| 234 | 233 | } | |
| 235 | 234 | ||
| 236 | - Environment::TickInfo* tick_info = env()->tick_info(); | ||
| 237 | - | ||
| 238 | 235 | if (callback_scope.in_makecallback()) { | |
| 239 | 236 | return ret; | |
| 240 | 237 | } | |
| 241 | 238 | ||
| 239 | + Environment::TickInfo* tick_info = env()->tick_info(); | ||
| 240 | + | ||
| 242 | 241 | if (tick_info->length() == 0) { | |
| 243 | 242 | env()->isolate()->RunMicrotasks(); | |
| 244 | 243 | } | |
| 245 | 244 | ||
| 245 | + Local<Object> process = env()->process_object(); | ||
| 246 | + | ||
| 246 | 247 | if (tick_info->length() == 0) { | |
| 247 | 248 | tick_info->set_index(0); | |
| 248 | 249 | return ret; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -64,27 +64,4 @@ void Environment::PrintSyncTrace() const { | |||
| 64 | 64 | fflush(stderr); | |
| 65 | 65 | } | |
| 66 | 66 | ||
| 67 | - | ||
| 68 | - bool Environment::KickNextTick(Environment::AsyncCallbackScope* scope) { | ||
| 69 | - TickInfo* info = tick_info(); | ||
| 70 | - | ||
| 71 | - if (scope->in_makecallback()) { | ||
| 72 | - return true; | ||
| 73 | - } | ||
| 74 | - | ||
| 75 | - if (info->length() == 0) { | ||
| 76 | - isolate()->RunMicrotasks(); | ||
| 77 | - } | ||
| 78 | - | ||
| 79 | - if (info->length() == 0) { | ||
| 80 | - info->set_index(0); | ||
| 81 | - return true; | ||
| 82 | - } | ||
| 83 | - | ||
| 84 | - Local<Value> ret = | ||
| 85 | - tick_callback_function()->Call(process_object(), 0, nullptr); | ||
| 86 | - | ||
| 87 | - return !ret.IsEmpty(); | ||
| 88 | - } | ||
| 89 | - | ||
| 90 | 67 | } // namespace node | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -467,8 +467,6 @@ class Environment { | |||
| 467 | 467 | ||
| 468 | 468 | inline int64_t get_async_wrap_uid(); | |
| 469 | 469 | ||
| 470 | - bool KickNextTick(AsyncCallbackScope* scope); | ||
| 471 | - | ||
| 472 | 470 | inline uint32_t* heap_statistics_buffer() const; | |
| 473 | 471 | inline void set_heap_statistics_buffer(uint32_t* pointer); | |
| 474 | 472 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1204,7 +1204,23 @@ Local<Value> MakeCallback(Environment* env, | |||
| 1204 | 1204 | } | |
| 1205 | 1205 | } | |
| 1206 | 1206 | ||
| 1207 | - if (!env->KickNextTick(&callback_scope)) { | ||
| 1207 | + if (callback_scope.in_makecallback()) { | ||
| 1208 | + return ret; | ||
| 1209 | + } | ||
| 1210 | + | ||
| 1211 | + Environment::TickInfo* tick_info = env->tick_info(); | ||
| 1212 | + | ||
| 1213 | + if (tick_info->length() == 0) { | ||
| 1214 | + env->isolate()->RunMicrotasks(); | ||
| 1215 | + } | ||
| 1216 | + | ||
| 1217 | + Local<Object> process = env->process_object(); | ||
| 1218 | + | ||
| 1219 | + if (tick_info->length() == 0) { | ||
| 1220 | + tick_info->set_index(0); | ||
| 1221 | + } | ||
| 1222 | + | ||
| 1223 | + if (env->tick_callback_function()->Call(process, 0, nullptr).IsEmpty()) { | ||
| 1208 | 1224 | return Undefined(env->isolate()); | |
| 1209 | 1225 | } | |
| 1210 | 1226 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -587,8 +587,6 @@ class Parser : public AsyncWrap { | |||
| 587 | 587 | if (!cb->IsFunction()) | |
| 588 | 588 | return; | |
| 589 | 589 | ||
| 590 | - Environment::AsyncCallbackScope callback_scope(parser->env()); | ||
| 591 | - | ||
| 592 | 590 | // Hooks for GetCurrentBuffer | |
| 593 | 591 | parser->current_buffer_len_ = nread; | |
| 594 | 592 | parser->current_buffer_data_ = buf->base; | |
@@ -597,8 +595,6 @@ class Parser : public AsyncWrap { | |||
| 597 | 595 | ||
| 598 | 596 | parser->current_buffer_len_ = 0; | |
| 599 | 597 | parser->current_buffer_data_ = nullptr; | |
| 600 | - | ||
| 601 | - parser->env()->KickNextTick(&callback_scope); | ||
| 602 | 598 | } | |
| 603 | 599 | ||
| 604 | 600 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments