From 594a84d8f2cb3c630744487d02dbcff05675d6cf Mon Sep 17 00:00:00 2001 From: Michaƫl Zasso Date: Sun, 2 Sep 2018 17:49:11 +0200 Subject: 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 Reviewed-By: Minwoo Jung Reviewed-By: James M Snell Reviewed-By: Ujjwal Sharma --- src/cares_wrap.cc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'src/cares_wrap.cc') diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc index 376af021f8..c74678977d 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& args) { int32_t flags = 0; if (args[3]->IsInt32()) { - flags = args[3]->Int32Value(env->context()).FromJust(); + flags = args[3].As()->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()->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()); -- cgit v1.2.3