|
29 | 29 |
|
30 | 30 | #include "v8.h" |
31 | 31 |
|
32 | | -using v8::Array; |
33 | 32 | using v8::Context; |
34 | 33 | using v8::DontDelete; |
35 | 34 | using v8::EscapableHandleScope; |
@@ -514,36 +513,6 @@ static void RegisterDestroyHook(const FunctionCallbackInfo<Value>& args) { |
514 | 513 | p->env->AddCleanupHook(DestroyParamCleanupHook, p); |
515 | 514 | } |
516 | 515 |
|
517 | | -static void GetActiveRequests(const FunctionCallbackInfo<Value>& args) { |
518 | | - Environment* env = Environment::GetCurrent(args); |
519 | | - |
520 | | - std::vector<Local<Value>> request_v; |
521 | | - for (ReqWrapBase* req_wrap : *env->req_wrap_queue()) { |
522 | | - AsyncWrap* w = req_wrap->GetAsyncWrap(); |
523 | | - if (w->persistent().IsEmpty()) |
524 | | - continue; |
525 | | - request_v.emplace_back(w->GetOwner()); |
526 | | - } |
527 | | - |
528 | | - args.GetReturnValue().Set( |
529 | | - Array::New(env->isolate(), request_v.data(), request_v.size())); |
530 | | -} |
531 | | - |
532 | | -// Non-static, friend of HandleWrap. Could have been a HandleWrap method but |
533 | | -// implemented here for consistency with GetActiveRequests(). |
534 | | -void GetActiveHandles(const FunctionCallbackInfo<Value>& args) { |
535 | | - Environment* env = Environment::GetCurrent(args); |
536 | | - |
537 | | - std::vector<Local<Value>> handle_v; |
538 | | - for (auto w : *env->handle_wrap_queue()) { |
539 | | - if (!HandleWrap::HasRef(w)) |
540 | | - continue; |
541 | | - handle_v.emplace_back(w->GetOwner()); |
542 | | - } |
543 | | - args.GetReturnValue().Set( |
544 | | - Array::New(env->isolate(), handle_v.data(), handle_v.size())); |
545 | | -} |
546 | | - |
547 | 516 | void AsyncWrap::GetAsyncId(const FunctionCallbackInfo<Value>& args) { |
548 | 517 | AsyncWrap* wrap; |
549 | 518 | args.GetReturnValue().Set(kInvalidAsyncId); |
@@ -665,9 +634,6 @@ void AsyncWrap::Initialize(Local<Object> target, |
665 | 634 | env->SetMethod(target, "disablePromiseHook", DisablePromiseHook); |
666 | 635 | env->SetMethod(target, "registerDestroyHook", RegisterDestroyHook); |
667 | 636 |
|
668 | | - env->SetMethod(target, "getActiveRequests", GetActiveRequests); |
669 | | - env->SetMethod(target, "getActiveHandles", GetActiveHandles); |
670 | | - |
671 | 637 | PropertyAttribute ReadOnlyDontDelete = |
672 | 638 | static_cast<PropertyAttribute>(ReadOnly | DontDelete); |
673 | 639 |
|
@@ -766,8 +732,6 @@ void AsyncWrap::RegisterExternalReferences( |
766 | 732 | registry->Register(AsyncWrap::GetProviderType); |
767 | 733 | registry->Register(PromiseWrap::GetAsyncId); |
768 | 734 | registry->Register(PromiseWrap::GetTriggerAsyncId); |
769 | | - registry->Register(GetActiveRequests); |
770 | | - registry->Register(GetActiveHandles); |
771 | 735 | } |
772 | 736 |
|
773 | 737 | AsyncWrap::AsyncWrap(Environment* env, |
|
0 commit comments