diff options
author | Ujjwal Sharma <usharma1998@gmail.com> | 2018-08-02 02:30:46 +0530 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2018-09-01 20:37:08 +0200 |
commit | 59e5a39d300aba3c018e7abb13f4f3e94a1398d4 (patch) | |
tree | ea957f2a3a710cc8da9120af893ce8faa3a8adef /src | |
parent | c8880ea27645aec31ef9dd5687c57747f338d67f (diff) | |
download | android-node-v8-59e5a39d300aba3c018e7abb13f4f3e94a1398d4.tar.gz android-node-v8-59e5a39d300aba3c018e7abb13f4f3e94a1398d4.tar.bz2 android-node-v8-59e5a39d300aba3c018e7abb13f4f3e94a1398d4.zip |
src: remove calls to deprecated v8 functions (BooleanValue)
Remove all calls to deprecated v8 functions (here:
Value::BooleanValue) inside the code (src directory only).
PR-URL: https://github.com/nodejs/node/pull/22075
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_crypto.cc | 5 | ||||
-rw-r--r-- | src/node_file.cc | 2 | ||||
-rw-r--r-- | src/node_i18n.cc | 4 | ||||
-rw-r--r-- | src/tcp_wrap.cc | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 4a81918e94..89274941aa 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3093,7 +3093,7 @@ void CipherBase::SetAutoPadding(const FunctionCallbackInfo<Value>& args) { CipherBase* cipher; ASSIGN_OR_RETURN_UNWRAP(&cipher, args.Holder()); - bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->BooleanValue()); + bool b = cipher->SetAutoPadding(args.Length() < 1 || args[0]->IsTrue()); args.GetReturnValue().Set(b); // Possibly report invalid state failure } @@ -5187,7 +5187,8 @@ void SetFipsCrypto(const FunctionCallbackInfo<Value>& args) { CHECK(!force_fips_crypto); Environment* env = Environment::GetCurrent(args); const bool enabled = FIPS_mode(); - const bool enable = args[0]->BooleanValue(); + bool enable; + if (!args[0]->BooleanValue(env->context()).To(&enable)) return; if (enable == enabled) return; // No action needed. if (!FIPS_mode_set(enable)) { diff --git a/src/node_file.cc b/src/node_file.cc index fb976a31a5..c1a936810f 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -1460,7 +1460,7 @@ static void ReadDir(const FunctionCallbackInfo<Value>& args) { const enum encoding encoding = ParseEncoding(env->isolate(), args[1], UTF8); - bool with_types = args[2]->BooleanValue(); + bool with_types = args[2]->IsTrue(); FSReqBase* req_wrap_async = GetReqWrap(env, args[3]); if (req_wrap_async != nullptr) { // readdir(path, encoding, withTypes, req) diff --git a/src/node_i18n.cc b/src/node_i18n.cc index e6c198fb63..e5d5c0d412 100644 --- a/src/node_i18n.cc +++ b/src/node_i18n.cc @@ -815,8 +815,8 @@ static void GetStringWidth(const FunctionCallbackInfo<Value>& args) { if (args.Length() < 1) return; - bool ambiguous_as_full_width = args[1]->BooleanValue(); - bool expand_emoji_sequence = args[2]->BooleanValue(); + bool ambiguous_as_full_width = args[1]->IsTrue(); + bool expand_emoji_sequence = args[2]->IsTrue(); if (args[0]->IsNumber()) { args.GetReturnValue().Set( diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index ebc82f4668..ab8b30e846 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -168,7 +168,7 @@ void TCPWrap::SetNoDelay(const FunctionCallbackInfo<Value>& args) { ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); - int enable = static_cast<int>(args[0]->BooleanValue()); + int enable = static_cast<int>(args[0]->IsTrue()); int err = uv_tcp_nodelay(&wrap->handle_, enable); args.GetReturnValue().Set(err); } @@ -192,7 +192,7 @@ void TCPWrap::SetSimultaneousAccepts(const FunctionCallbackInfo<Value>& args) { ASSIGN_OR_RETURN_UNWRAP(&wrap, args.Holder(), args.GetReturnValue().Set(UV_EBADF)); - bool enable = args[0]->BooleanValue(); + bool enable = args[0]->IsTrue(); int err = uv_tcp_simultaneous_accepts(&wrap->handle_, enable); args.GetReturnValue().Set(err); } |