@@ -1876,12 +1876,13 @@ void Initialize(Local<Object> target,
1876
1876
Local<Context> context,
1877
1877
void * priv) {
1878
1878
Environment* env = Environment::GetCurrent (context);
1879
+ Isolate* isolate = env->isolate ();
1879
1880
1880
- env-> SetMethod (target, " getaddrinfo" , GetAddrInfo);
1881
- env-> SetMethod (target, " getnameinfo" , GetNameInfo);
1882
- env-> SetMethodNoSideEffect (target, " canonicalizeIP" , CanonicalizeIP);
1881
+ SetMethod (context, target, " getaddrinfo" , GetAddrInfo);
1882
+ SetMethod (context, target, " getnameinfo" , GetNameInfo);
1883
+ SetMethodNoSideEffect (context, target, " canonicalizeIP" , CanonicalizeIP);
1883
1884
1884
- env-> SetMethod (target, " strerror" , StrError);
1885
+ SetMethod (context, target, " strerror" , StrError);
1885
1886
1886
1887
target->Set (env->context (), FIXED_ONE_BYTE_STRING (env->isolate (), " AF_INET" ),
1887
1888
Integer::New (env->isolate (), AF_INET)).Check ();
@@ -1903,44 +1904,45 @@ void Initialize(Local<Object> target,
1903
1904
Local<FunctionTemplate> aiw =
1904
1905
BaseObject::MakeLazilyInitializedJSTemplate (env);
1905
1906
aiw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1906
- env-> SetConstructorFunction (target, " GetAddrInfoReqWrap" , aiw);
1907
+ SetConstructorFunction (context, target, " GetAddrInfoReqWrap" , aiw);
1907
1908
1908
1909
Local<FunctionTemplate> niw =
1909
1910
BaseObject::MakeLazilyInitializedJSTemplate (env);
1910
1911
niw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1911
- env-> SetConstructorFunction (target, " GetNameInfoReqWrap" , niw);
1912
+ SetConstructorFunction (context, target, " GetNameInfoReqWrap" , niw);
1912
1913
1913
1914
Local<FunctionTemplate> qrw =
1914
1915
BaseObject::MakeLazilyInitializedJSTemplate (env);
1915
1916
qrw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1916
- env-> SetConstructorFunction (target, " QueryReqWrap" , qrw);
1917
+ SetConstructorFunction (context, target, " QueryReqWrap" , qrw);
1917
1918
1918
1919
Local<FunctionTemplate> channel_wrap =
1919
- env-> NewFunctionTemplate (ChannelWrap::New);
1920
+ NewFunctionTemplate (isolate, ChannelWrap::New);
1920
1921
channel_wrap->InstanceTemplate ()->SetInternalFieldCount (
1921
1922
ChannelWrap::kInternalFieldCount );
1922
1923
channel_wrap->Inherit (AsyncWrap::GetConstructorTemplate (env));
1923
1924
1924
- env->SetProtoMethod (channel_wrap, " queryAny" , Query<QueryAnyWrap>);
1925
- env->SetProtoMethod (channel_wrap, " queryA" , Query<QueryAWrap>);
1926
- env->SetProtoMethod (channel_wrap, " queryAaaa" , Query<QueryAaaaWrap>);
1927
- env->SetProtoMethod (channel_wrap, " queryCaa" , Query<QueryCaaWrap>);
1928
- env->SetProtoMethod (channel_wrap, " queryCname" , Query<QueryCnameWrap>);
1929
- env->SetProtoMethod (channel_wrap, " queryMx" , Query<QueryMxWrap>);
1930
- env->SetProtoMethod (channel_wrap, " queryNs" , Query<QueryNsWrap>);
1931
- env->SetProtoMethod (channel_wrap, " queryTxt" , Query<QueryTxtWrap>);
1932
- env->SetProtoMethod (channel_wrap, " querySrv" , Query<QuerySrvWrap>);
1933
- env->SetProtoMethod (channel_wrap, " queryPtr" , Query<QueryPtrWrap>);
1934
- env->SetProtoMethod (channel_wrap, " queryNaptr" , Query<QueryNaptrWrap>);
1935
- env->SetProtoMethod (channel_wrap, " querySoa" , Query<QuerySoaWrap>);
1936
- env->SetProtoMethod (channel_wrap, " getHostByAddr" , Query<GetHostByAddrWrap>);
1937
-
1938
- env->SetProtoMethodNoSideEffect (channel_wrap, " getServers" , GetServers);
1939
- env->SetProtoMethod (channel_wrap, " setServers" , SetServers);
1940
- env->SetProtoMethod (channel_wrap, " setLocalAddress" , SetLocalAddress);
1941
- env->SetProtoMethod (channel_wrap, " cancel" , Cancel);
1942
-
1943
- env->SetConstructorFunction (target, " ChannelWrap" , channel_wrap);
1925
+ SetProtoMethod (isolate, channel_wrap, " queryAny" , Query<QueryAnyWrap>);
1926
+ SetProtoMethod (isolate, channel_wrap, " queryA" , Query<QueryAWrap>);
1927
+ SetProtoMethod (isolate, channel_wrap, " queryAaaa" , Query<QueryAaaaWrap>);
1928
+ SetProtoMethod (isolate, channel_wrap, " queryCaa" , Query<QueryCaaWrap>);
1929
+ SetProtoMethod (isolate, channel_wrap, " queryCname" , Query<QueryCnameWrap>);
1930
+ SetProtoMethod (isolate, channel_wrap, " queryMx" , Query<QueryMxWrap>);
1931
+ SetProtoMethod (isolate, channel_wrap, " queryNs" , Query<QueryNsWrap>);
1932
+ SetProtoMethod (isolate, channel_wrap, " queryTxt" , Query<QueryTxtWrap>);
1933
+ SetProtoMethod (isolate, channel_wrap, " querySrv" , Query<QuerySrvWrap>);
1934
+ SetProtoMethod (isolate, channel_wrap, " queryPtr" , Query<QueryPtrWrap>);
1935
+ SetProtoMethod (isolate, channel_wrap, " queryNaptr" , Query<QueryNaptrWrap>);
1936
+ SetProtoMethod (isolate, channel_wrap, " querySoa" , Query<QuerySoaWrap>);
1937
+ SetProtoMethod (
1938
+ isolate, channel_wrap, " getHostByAddr" , Query<GetHostByAddrWrap>);
1939
+
1940
+ SetProtoMethodNoSideEffect (isolate, channel_wrap, " getServers" , GetServers);
1941
+ SetProtoMethod (isolate, channel_wrap, " setServers" , SetServers);
1942
+ SetProtoMethod (isolate, channel_wrap, " setLocalAddress" , SetLocalAddress);
1943
+ SetProtoMethod (isolate, channel_wrap, " cancel" , Cancel);
1944
+
1945
+ SetConstructorFunction (context, target, " ChannelWrap" , channel_wrap);
1944
1946
}
1945
1947
1946
1948
} // namespace cares_wrap
0 commit comments