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/udp_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/udp_wrap.cc')
-rw-r--r-- | src/udp_wrap.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/udp_wrap.cc b/src/udp_wrap.cc index 27d4c7959c3..c7ca7fc44d6 100644 --- a/src/udp_wrap.cc +++ b/src/udp_wrap.cc @@ -267,14 +267,17 @@ void UDPWrap::BufferSize(const FunctionCallbackInfo<Value>& args) { args.GetReturnValue().Set(size); } - -#define X(name, fn) \ - void UDPWrap::name(const FunctionCallbackInfo<Value>& args) { \ - UDPWrap* wrap = Unwrap<UDPWrap>(args.Holder()); \ - CHECK_EQ(args.Length(), 1); \ - int flag = args[0]->Int32Value(); \ - int err = wrap == nullptr ? UV_EBADF : fn(&wrap->handle_, flag); \ - args.GetReturnValue().Set(err); \ +#define X(name, fn) \ + void UDPWrap::name(const FunctionCallbackInfo<Value>& args) { \ + UDPWrap* wrap = Unwrap<UDPWrap>(args.Holder()); \ + Environment* env = wrap->env(); \ + CHECK_EQ(args.Length(), 1); \ + int flag; \ + if (!args[0]->Int32Value(env->context()).To(&flag)) { \ + return; \ + } \ + int err = wrap == nullptr ? UV_EBADF : fn(&wrap->handle_, flag); \ + args.GetReturnValue().Set(err); \ } X(SetTTL, uv_udp_set_ttl) |