diff options
author | Michaƫl Zasso <targos@protonmail.com> | 2018-09-02 18:49:11 +0300 |
---|---|---|
committer | Daniel Bevenius <daniel.bevenius@gmail.com> | 2018-09-05 13:59:25 +0300 |
commit | 594a84d8f2cb3c630744487d02dbcff05675d6cf (patch) | |
tree | ae066c7a853f3a42ee0febc3d9027c2cdc9bc013 /src/cares_wrap.cc | |
parent | d6a43438d6ed3f262cc87fe2ebd0c46a87c1ff57 (diff) |
src: remove calls to deprecated V8 functions (Int32Value)
Remove all calls to deprecated V8 functions (here: Value::Int32Value)
inside the code.
PR-URL: https://github.com/nodejs/node/pull/22662
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Diffstat (limited to 'src/cares_wrap.cc')
-rw-r--r-- | src/cares_wrap.cc | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 376af021f80..c74678977d6 100644 --- a/src/cares_wrap.cc +++ b/src/cares_wrap.cc @@ -61,6 +61,7 @@ using v8::EscapableHandleScope; using v8::FunctionCallbackInfo; using v8::FunctionTemplate; using v8::HandleScope; +using v8::Int32; using v8::Integer; using v8::Local; using v8::Null; @@ -1987,23 +1988,23 @@ void GetAddrInfo(const FunctionCallbackInfo<Value>& args) { int32_t flags = 0; if (args[3]->IsInt32()) { - flags = args[3]->Int32Value(env->context()).FromJust(); + flags = args[3].As<Int32>()->Value(); } int family; - switch (args[2]->Int32Value(env->context()).FromJust()) { - case 0: - family = AF_UNSPEC; - break; - case 4: - family = AF_INET; - break; - case 6: - family = AF_INET6; - break; - default: - CHECK(0 && "bad address family"); + switch (args[2].As<Int32>()->Value()) { + case 0: + family = AF_UNSPEC; + break; + case 4: + family = AF_INET; + break; + case 6: + family = AF_INET6; + break; + default: + CHECK(0 && "bad address family"); } auto req_wrap = new GetAddrInfoReqWrap(env, req_wrap_obj, args[4]->IsTrue()); |