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/tty_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/tty_wrap.cc')
-rw-r--r-- | src/tty_wrap.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index f1cfa300f8f..8151ba02a2a 100644 --- a/src/tty_wrap.cc +++ b/src/tty_wrap.cc @@ -75,7 +75,8 @@ uv_tty_t* TTYWrap::UVHandle() { void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) { Environment* env = Environment::GetCurrent(args); - int fd = args[0]->Int32Value(); + int fd; + if (!args[0]->Int32Value(env->context()).To(&fd)) return; CHECK_GE(fd, 0); uv_handle_type t = uv_guess_handle(fd); @@ -97,7 +98,9 @@ void TTYWrap::GuessHandleType(const FunctionCallbackInfo<Value>& args) { void TTYWrap::IsTTY(const FunctionCallbackInfo<Value>& args) { - int fd = args[0]->Int32Value(); + Environment* env = Environment::GetCurrent(args); + int fd; + if (!args[0]->Int32Value(env->context()).To(&fd)) return; CHECK_GE(fd, 0); bool rc = uv_guess_handle(fd) == UV_TTY; args.GetReturnValue().Set(rc); @@ -144,7 +147,8 @@ void TTYWrap::New(const FunctionCallbackInfo<Value>& args) { // normal function. CHECK(args.IsConstructCall()); - int fd = args[0]->Int32Value(); + int fd; + if (!args[0]->Int32Value(env->context()).To(&fd)) return; CHECK_GE(fd, 0); int err = 0; |