@@ -1886,12 +1886,13 @@ void Initialize(Local<Object> target,
1886
1886
Local<Context> context,
1887
1887
void * priv) {
1888
1888
Environment* env = Environment::GetCurrent (context);
1889
+ Isolate* isolate = env->isolate ();
1889
1890
1890
- env-> SetMethod (target, " getaddrinfo" , GetAddrInfo);
1891
- env-> SetMethod (target, " getnameinfo" , GetNameInfo);
1892
- env-> SetMethodNoSideEffect (target, " canonicalizeIP" , CanonicalizeIP);
1891
+ SetMethod (context, target, " getaddrinfo" , GetAddrInfo);
1892
+ SetMethod (context, target, " getnameinfo" , GetNameInfo);
1893
+ SetMethodNoSideEffect (context, target, " canonicalizeIP" , CanonicalizeIP);
1893
1894
1894
- env-> SetMethod (target, " strerror" , StrError);
1895
+ SetMethod (context, target, " strerror" , StrError);
1895
1896
1896
1897
target->Set (env->context (), FIXED_ONE_BYTE_STRING (env->isolate (), " AF_INET" ),
1897
1898
Integer::New (env->isolate (), AF_INET)).Check ();
@@ -1913,44 +1914,45 @@ void Initialize(Local<Object> target,
1913
1914
Local<FunctionTemplate> aiw =
1914
1915
BaseObject::MakeLazilyInitializedJSTemplate (env);
1915
1916
aiw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1916
- env-> SetConstructorFunction (target, " GetAddrInfoReqWrap" , aiw);
1917
+ SetConstructorFunction (context, target, " GetAddrInfoReqWrap" , aiw);
1917
1918
1918
1919
Local<FunctionTemplate> niw =
1919
1920
BaseObject::MakeLazilyInitializedJSTemplate (env);
1920
1921
niw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1921
- env-> SetConstructorFunction (target, " GetNameInfoReqWrap" , niw);
1922
+ SetConstructorFunction (context, target, " GetNameInfoReqWrap" , niw);
1922
1923
1923
1924
Local<FunctionTemplate> qrw =
1924
1925
BaseObject::MakeLazilyInitializedJSTemplate (env);
1925
1926
qrw->Inherit (AsyncWrap::GetConstructorTemplate (env));
1926
- env-> SetConstructorFunction (target, " QueryReqWrap" , qrw);
1927
+ SetConstructorFunction (context, target, " QueryReqWrap" , qrw);
1927
1928
1928
1929
Local<FunctionTemplate> channel_wrap =
1929
- env-> NewFunctionTemplate (ChannelWrap::New);
1930
+ NewFunctionTemplate (isolate, ChannelWrap::New);
1930
1931
channel_wrap->InstanceTemplate ()->SetInternalFieldCount (
1931
1932
ChannelWrap::kInternalFieldCount );
1932
1933
channel_wrap->Inherit (AsyncWrap::GetConstructorTemplate (env));
1933
1934
1934
- env->SetProtoMethod (channel_wrap, " queryAny" , Query<QueryAnyWrap>);
1935
- env->SetProtoMethod (channel_wrap, " queryA" , Query<QueryAWrap>);
1936
- env->SetProtoMethod (channel_wrap, " queryAaaa" , Query<QueryAaaaWrap>);
1937
- env->SetProtoMethod (channel_wrap, " queryCaa" , Query<QueryCaaWrap>);
1938
- env->SetProtoMethod (channel_wrap, " queryCname" , Query<QueryCnameWrap>);
1939
- env->SetProtoMethod (channel_wrap, " queryMx" , Query<QueryMxWrap>);
1940
- env->SetProtoMethod (channel_wrap, " queryNs" , Query<QueryNsWrap>);
1941
- env->SetProtoMethod (channel_wrap, " queryTxt" , Query<QueryTxtWrap>);
1942
- env->SetProtoMethod (channel_wrap, " querySrv" , Query<QuerySrvWrap>);
1943
- env->SetProtoMethod (channel_wrap, " queryPtr" , Query<QueryPtrWrap>);
1944
- env->SetProtoMethod (channel_wrap, " queryNaptr" , Query<QueryNaptrWrap>);
1945
- env->SetProtoMethod (channel_wrap, " querySoa" , Query<QuerySoaWrap>);
1946
- env->SetProtoMethod (channel_wrap, " getHostByAddr" , Query<GetHostByAddrWrap>);
1947
-
1948
- env->SetProtoMethodNoSideEffect (channel_wrap, " getServers" , GetServers);
1949
- env->SetProtoMethod (channel_wrap, " setServers" , SetServers);
1950
- env->SetProtoMethod (channel_wrap, " setLocalAddress" , SetLocalAddress);
1951
- env->SetProtoMethod (channel_wrap, " cancel" , Cancel);
1952
-
1953
- env->SetConstructorFunction (target, " ChannelWrap" , channel_wrap);
1935
+ SetProtoMethod (isolate, channel_wrap, " queryAny" , Query<QueryAnyWrap>);
1936
+ SetProtoMethod (isolate, channel_wrap, " queryA" , Query<QueryAWrap>);
1937
+ SetProtoMethod (isolate, channel_wrap, " queryAaaa" , Query<QueryAaaaWrap>);
1938
+ SetProtoMethod (isolate, channel_wrap, " queryCaa" , Query<QueryCaaWrap>);
1939
+ SetProtoMethod (isolate, channel_wrap, " queryCname" , Query<QueryCnameWrap>);
1940
+ SetProtoMethod (isolate, channel_wrap, " queryMx" , Query<QueryMxWrap>);
1941
+ SetProtoMethod (isolate, channel_wrap, " queryNs" , Query<QueryNsWrap>);
1942
+ SetProtoMethod (isolate, channel_wrap, " queryTxt" , Query<QueryTxtWrap>);
1943
+ SetProtoMethod (isolate, channel_wrap, " querySrv" , Query<QuerySrvWrap>);
1944
+ SetProtoMethod (isolate, channel_wrap, " queryPtr" , Query<QueryPtrWrap>);
1945
+ SetProtoMethod (isolate, channel_wrap, " queryNaptr" , Query<QueryNaptrWrap>);
1946
+ SetProtoMethod (isolate, channel_wrap, " querySoa" , Query<QuerySoaWrap>);
1947
+ SetProtoMethod (
1948
+ isolate, channel_wrap, " getHostByAddr" , Query<GetHostByAddrWrap>);
1949
+
1950
+ SetProtoMethodNoSideEffect (isolate, channel_wrap, " getServers" , GetServers);
1951
+ SetProtoMethod (isolate, channel_wrap, " setServers" , SetServers);
1952
+ SetProtoMethod (isolate, channel_wrap, " setLocalAddress" , SetLocalAddress);
1953
+ SetProtoMethod (isolate, channel_wrap, " cancel" , Cancel);
1954
+
1955
+ SetConstructorFunction (context, target, " ChannelWrap" , channel_wrap);
1954
1956
}
1955
1957
1956
1958
} // namespace cares_wrap
0 commit comments