@@ -54,7 +54,6 @@ using v8::PropertyAttribute;
54
54
using v8::PropertyCallbackInfo;
55
55
using v8::ReadOnly;
56
56
using v8::String;
57
- using v8::Uint32;
58
57
using v8::Undefined;
59
58
using v8::Value;
60
59
using v8::WeakCallbackInfo;
@@ -71,45 +70,6 @@ static const char* const provider_names[] = {
71
70
#undef V
72
71
};
73
72
74
-
75
- struct AsyncWrapObject : public AsyncWrap {
76
- static inline void New (const FunctionCallbackInfo<Value>& args) {
77
- Environment* env = Environment::GetCurrent (args);
78
- CHECK (args.IsConstructCall ());
79
- CHECK (env->async_wrap_object_ctor_template ()->HasInstance (args.This ()));
80
- CHECK (args[0 ]->IsUint32 ());
81
- auto type = static_cast <ProviderType>(args[0 ].As <Uint32>()->Value ());
82
- new AsyncWrapObject (env, args.This (), type);
83
- }
84
-
85
- inline AsyncWrapObject (Environment* env, Local<Object> object,
86
- ProviderType type) : AsyncWrap(env, object, type) {}
87
-
88
- static Local<FunctionTemplate> GetConstructorTemplate (Environment* env) {
89
- Local<FunctionTemplate> tmpl = env->async_wrap_object_ctor_template ();
90
- if (tmpl.IsEmpty ()) {
91
- tmpl = env->NewFunctionTemplate (AsyncWrapObject::New);
92
- tmpl->SetClassName (
93
- FIXED_ONE_BYTE_STRING (env->isolate (), " AsyncWrap" ));
94
- tmpl->Inherit (AsyncWrap::GetConstructorTemplate (env));
95
- tmpl->InstanceTemplate ()->SetInternalFieldCount (
96
- AsyncWrapObject::kInternalFieldCount );
97
- env->set_async_wrap_object_ctor_template (tmpl);
98
- }
99
- return tmpl;
100
- }
101
-
102
- bool IsNotIndicativeOfMemoryLeakAtExit () const override {
103
- // We can't really know what the underlying operation does. One of the
104
- // signs that it's time to remove this class. :)
105
- return true ;
106
- }
107
-
108
- SET_NO_MEMORY_INFO ()
109
- SET_MEMORY_INFO_NAME (AsyncWrapObject)
110
- SET_SELF_SIZE (AsyncWrapObject)
111
- };
112
-
113
73
void AsyncWrap::DestroyAsyncIdsCallback (Environment* env) {
114
74
Local<Function> fn = env->async_hooks_destroy_function ();
115
75
@@ -751,11 +711,6 @@ void AsyncWrap::Initialize(Local<Object> target,
751
711
env->set_async_hooks_promise_resolve_function (Local<Function>());
752
712
env->set_async_hooks_binding (target);
753
713
754
- target->Set (env->context (),
755
- FIXED_ONE_BYTE_STRING (env->isolate (), " AsyncWrap" ),
756
- AsyncWrapObject::GetConstructorTemplate (env)
757
- ->GetFunction (env->context ()).ToLocalChecked ()).Check ();
758
-
759
714
// TODO(qard): maybe this should be GetConstructorTemplate instead?
760
715
PromiseWrap::Initialize (env);
761
716
}
@@ -772,7 +727,6 @@ void AsyncWrap::RegisterExternalReferences(
772
727
registry->Register (EnablePromiseHook);
773
728
registry->Register (DisablePromiseHook);
774
729
registry->Register (RegisterDestroyHook);
775
- registry->Register (AsyncWrapObject::New);
776
730
registry->Register (AsyncWrap::GetAsyncId);
777
731
registry->Register (AsyncWrap::AsyncReset);
778
732
registry->Register (AsyncWrap::GetProviderType);
0 commit comments