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/pipe_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/pipe_wrap.cc')
-rw-r--r-- | src/pipe_wrap.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index 8fcf7007f59..00c0eef6549 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -173,7 +173,8 @@ void PipeWrap::Bind(const FunctionCallbackInfo<Value>& args) { void PipeWrap::SetPendingInstances(const FunctionCallbackInfo<Value>& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - int instances = args[0]->Int32Value(); + CHECK(args[0]->IsInt32()); + int instances = args[0].As<Int32>()->Value(); uv_pipe_pending_instances(&wrap->handle_, instances); } #endif @@ -193,7 +194,9 @@ void PipeWrap::Fchmod(const v8::FunctionCallbackInfo<v8::Value>& args) { void PipeWrap::Listen(const FunctionCallbackInfo<Value>& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - int backlog = args[0]->Int32Value(); + Environment* env = wrap->env(); + int backlog; + if (!args[0]->Int32Value(env->context()).To(&backlog)) return; int err = uv_listen(reinterpret_cast<uv_stream_t*>(&wrap->handle_), backlog, OnConnection); @@ -207,7 +210,8 @@ void PipeWrap::Open(const FunctionCallbackInfo<Value>& args) { PipeWrap* wrap; ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder()); - int fd = args[0]->Int32Value(); + int fd; + if (!args[0]->Int32Value(env->context()).To(&fd)) return; int err = uv_pipe_open(&wrap->handle_, fd); wrap->set_fd(fd); |