summaryrefslogtreecommitdiff
path: root/src/udp_wrap.cc
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-08-29 16:46:36 +0200
committerMichaƫl Zasso <targos@protonmail.com>2018-09-02 16:32:15 +0200
commit37cd10a1165537d25cd73454ffa81a4e964a56f7 (patch)
treed9146f1c17e1a7f5e0cfe9d3e8833c66662e7f7c /src/udp_wrap.cc
parent5da155398ef8645c76872c6db3114a3e796a80da (diff)
downloadandroid-node-v8-37cd10a1165537d25cd73454ffa81a4e964a56f7.tar.gz
android-node-v8-37cd10a1165537d25cd73454ffa81a4e964a56f7.tar.bz2
android-node-v8-37cd10a1165537d25cd73454ffa81a4e964a56f7.zip
src: remove calls to deprecated v8 functions (Uint32Value)
Remove all calls to deprecated v8 functions (here: Value::Uint32Value) inside the code (src directory only). PR-URL: https://github.com/nodejs/node/pull/22143 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>
Diffstat (limited to 'src/udp_wrap.cc')
-rw-r--r--src/udp_wrap.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc
index d23c62c14e..27d4c7959c 100644
--- a/src/udp_wrap.cc
+++ b/src/udp_wrap.cc
@@ -180,8 +180,11 @@ void UDPWrap::DoBind(const FunctionCallbackInfo<Value>& args, int family) {
CHECK_EQ(args.Length(), 3);
node::Utf8Value address(args.GetIsolate(), args[0]);
- const int port = args[1]->Uint32Value();
- const int flags = args[2]->Uint32Value();
+ Local<Context> ctx = args.GetIsolate()->GetCurrentContext();
+ uint32_t port, flags;
+ if (!args[1]->Uint32Value(ctx).To(&port) ||
+ !args[2]->Uint32Value(ctx).To(&flags))
+ return;
char addr[sizeof(sockaddr_in6)];
int err;
@@ -353,8 +356,8 @@ void UDPWrap::DoSend(const FunctionCallbackInfo<Value>& args, int family) {
Local<Array> chunks = args[1].As<Array>();
// it is faster to fetch the length of the
// array in js-land
- size_t count = args[2]->Uint32Value();
- const unsigned short port = args[3]->Uint32Value();
+ size_t count = args[2].As<Uint32>()->Value();
+ const unsigned short port = args[3].As<Uint32>()->Value();
node::Utf8Value address(env->isolate(), args[4]);
const bool have_callback = args[5]->IsTrue();