Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarshan Sen <darshan.sen@postman.com>2021-10-02 16:51:40 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2021-10-05 08:34:21 +0300
commit7b8552f5078f209fd3bbb935724d81cf5705aa11 (patch)
tree3861b845007351a23b6b1f85084a04a0c3c1bf0e /src/cares_wrap.cc
parent8fc4169452516669a2f66c670b423b8e14be0f77 (diff)
src: use `As()` instead of `Cast()` for conversions
We mostly use `As()` instead of `Cast()` in our code, so this change replaces the remaining calls to `Cast()` with calls to `As()` to maintain the consistency. Refs: https://github.com/nodejs/node/pull/39921/files#r702293529 Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: https://github.com/nodejs/node/pull/40287 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Diffstat (limited to 'src/cares_wrap.cc')
-rw-r--r--src/cares_wrap.cc5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/cares_wrap.cc b/src/cares_wrap.cc
index edc86761876..30e27ecf70a 100644
--- a/src/cares_wrap.cc
+++ b/src/cares_wrap.cc
@@ -1701,7 +1701,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsArray());
- Local<Array> arr = Local<Array>::Cast(args[0]);
+ Local<Array> arr = args[0].As<Array>();
uint32_t len = arr->Length();
@@ -1718,8 +1718,7 @@ void SetServers(const FunctionCallbackInfo<Value>& args) {
for (uint32_t i = 0; i < len; i++) {
CHECK(arr->Get(env->context(), i).ToLocalChecked()->IsArray());
- Local<Array> elm =
- Local<Array>::Cast(arr->Get(env->context(), i).ToLocalChecked());
+ Local<Array> elm = arr->Get(env->context(), i).ToLocalChecked().As<Array>();
CHECK(elm->Get(env->context(),
0).ToLocalChecked()->Int32Value(env->context()).FromJust());