summaryrefslogtreecommitdiff
path: root/src/tcp_wrap.cc
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-08-29 16:12:36 +0200
committerMichaël Zasso <targos@protonmail.com>2018-09-05 13:42:38 +0200
commitf464ac3c74ca2b2411c578b4dcb52838f569e9fa (patch)
treead733001a2528375cc3fd202a54c80ea8dfbab9c /src/tcp_wrap.cc
parent31ca5dc75a0d76d4aeee174e70e335e4ea7428ac (diff)
downloadandroid-node-v8-f464ac3c74ca2b2411c578b4dcb52838f569e9fa.tar.gz
android-node-v8-f464ac3c74ca2b2411c578b4dcb52838f569e9fa.tar.bz2
android-node-v8-f464ac3c74ca2b2411c578b4dcb52838f569e9fa.zip
src: remove calls to deprecated v8 functions (IntegerValue)
Remove all calls to deprecated v8 functions (here: Value::IntegerValue) inside the code (src directory only). Co-authored-by: Michaël Zasso <targos@protonmail.com> PR-URL: https://github.com/nodejs/node/pull/22129 Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'src/tcp_wrap.cc')
-rw-r--r--src/tcp_wrap.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc
index dd507e6ebd..d8080319aa 100644
--- a/src/tcp_wrap.cc
+++ b/src/tcp_wrap.cc
@@ -207,7 +207,10 @@ void TCPWrap::Open(const FunctionCallbackInfo<Value>& args) {
ASSIGN_OR_RETURN_UNWRAP(&wrap,
args.Holder(),
args.GetReturnValue().Set(UV_EBADF));
- int fd = static_cast<int>(args[0]->IntegerValue());
+ int64_t val;
+ if (!args[0]->IntegerValue(args.GetIsolate()->GetCurrentContext()).To(&val))
+ return;
+ int fd = static_cast<int>(val);
int err = uv_tcp_open(&wrap->handle_, fd);
if (err == 0)