@@ -115,11 +115,6 @@ GetAddrInfoReqWrap::GetAddrInfoReqWrap(Environment* env,
115
115
}
116
116
117
117
118
- void NewGetAddrInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
119
- CHECK (args.IsConstructCall ());
120
- }
121
-
122
-
123
118
class GetNameInfoReqWrap : public ReqWrap <uv_getnameinfo_t > {
124
119
public:
125
120
GetNameInfoReqWrap (Environment* env, Local<Object> req_wrap_obj);
@@ -134,16 +129,6 @@ GetNameInfoReqWrap::GetNameInfoReqWrap(Environment* env,
134
129
}
135
130
136
131
137
- void NewGetNameInfoReqWrap (const FunctionCallbackInfo<Value>& args) {
138
- CHECK (args.IsConstructCall ());
139
- }
140
-
141
-
142
- void NewQueryReqWrap (const FunctionCallbackInfo<Value>& args) {
143
- CHECK (args.IsConstructCall ());
144
- }
145
-
146
-
147
132
int cmp_ares_tasks (const node_ares_task* a, const node_ares_task* b) {
148
133
if (a->sock < b->sock )
149
134
return -1 ;
@@ -1400,24 +1385,28 @@ void Initialize(Local<Object> target,
1400
1385
target->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " AI_V4MAPPED" ),
1401
1386
Integer::New (env->isolate (), AI_V4MAPPED));
1402
1387
1388
+ auto is_construct_call_callback =
1389
+ [](const FunctionCallbackInfo<Value>& args) {
1390
+ CHECK (args.IsConstructCall ());
1391
+ };
1403
1392
Local<FunctionTemplate> aiw =
1404
- FunctionTemplate::New (env->isolate (), NewGetAddrInfoReqWrap );
1393
+ FunctionTemplate::New (env->isolate (), is_construct_call_callback );
1405
1394
aiw->InstanceTemplate ()->SetInternalFieldCount (1 );
1406
1395
aiw->SetClassName (
1407
1396
FIXED_ONE_BYTE_STRING (env->isolate (), " GetAddrInfoReqWrap" ));
1408
1397
target->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " GetAddrInfoReqWrap" ),
1409
1398
aiw->GetFunction ());
1410
1399
1411
1400
Local<FunctionTemplate> niw =
1412
- FunctionTemplate::New (env->isolate (), NewGetNameInfoReqWrap );
1401
+ FunctionTemplate::New (env->isolate (), is_construct_call_callback );
1413
1402
niw->InstanceTemplate ()->SetInternalFieldCount (1 );
1414
1403
niw->SetClassName (
1415
1404
FIXED_ONE_BYTE_STRING (env->isolate (), " GetNameInfoReqWrap" ));
1416
1405
target->Set (FIXED_ONE_BYTE_STRING (env->isolate (), " GetNameInfoReqWrap" ),
1417
1406
niw->GetFunction ());
1418
1407
1419
1408
Local<FunctionTemplate> qrw =
1420
- FunctionTemplate::New (env->isolate (), NewQueryReqWrap );
1409
+ FunctionTemplate::New (env->isolate (), is_construct_call_callback );
1421
1410
qrw->InstanceTemplate ()->SetInternalFieldCount (1 );
1422
1411
qrw->SetClassName (
1423
1412
FIXED_ONE_BYTE_STRING (env->isolate (), " QueryReqWrap" ));
0 commit comments