diff options
Diffstat (limited to 'src/node.cc')
-rw-r--r-- | src/node.cc | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/src/node.cc b/src/node.cc index c8299f9a36..bffcd04cfd 100644 --- a/src/node.cc +++ b/src/node.cc @@ -33,7 +33,8 @@ #include "env.h" #include "env-inl.h" #include "handle_wrap.h" -#include "req_wrap.h" +#include "req-wrap.h" +#include "req-wrap-inl.h" #include "string_bytes.h" #include "util.h" #include "uv.h" @@ -1486,15 +1487,11 @@ static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); Local<Array> ary = Array::New(args.GetIsolate()); - QUEUE* q = nullptr; int i = 0; - QUEUE_FOREACH(q, env->req_wrap_queue()) { - ReqWrap<uv_req_t>* w = ContainerOf(&ReqWrap<uv_req_t>::req_wrap_queue_, q); - if (w->persistent().IsEmpty()) - continue; - ary->Set(i++, w->object()); - } + for (auto w : *env->req_wrap_queue()) + if (w->persistent().IsEmpty() == false) + ary->Set(i++, w->object()); args.GetReturnValue().Set(ary); } @@ -1506,13 +1503,11 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); Local<Array> ary = Array::New(env->isolate()); - QUEUE* q = nullptr; int i = 0; Local<String> owner_sym = env->owner_string(); - QUEUE_FOREACH(q, env->handle_wrap_queue()) { - HandleWrap* w = ContainerOf(&HandleWrap::handle_wrap_queue_, q); + for (auto w : *env->handle_wrap_queue()) { if (w->persistent().IsEmpty() || (w->flags_ & HandleWrap::kUnref)) continue; Local<Object> object = w->object(); |