From 594a84d8f2cb3c630744487d02dbcff05675d6cf Mon Sep 17 00:00:00 2001 From: Michaƫl Zasso Date: Sun, 2 Sep 2018 17:49:11 +0200 Subject: 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 Reviewed-By: Minwoo Jung Reviewed-By: James M Snell Reviewed-By: Ujjwal Sharma --- src/tty_wrap.cc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/tty_wrap.cc') diff --git a/src/tty_wrap.cc b/src/tty_wrap.cc index f1cfa300f8..8151ba02a2 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& 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& args) { void TTYWrap::IsTTY(const FunctionCallbackInfo& 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& 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; -- cgit v1.2.3