diff options
author | Darshan Sen <darshan.sen@postman.com> | 2021-10-02 16:51:40 +0300 |
---|---|---|
committer | Node.js GitHub Bot <github-bot@iojs.org> | 2021-10-05 08:34:21 +0300 |
commit | 7b8552f5078f209fd3bbb935724d81cf5705aa11 (patch) | |
tree | 3861b845007351a23b6b1f85084a04a0c3c1bf0e /src/process_wrap.cc | |
parent | 8fc4169452516669a2f66c670b423b8e14be0f77 (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/process_wrap.cc')
-rw-r--r-- | src/process_wrap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/process_wrap.cc b/src/process_wrap.cc index 679429286b8..6905cacb1c8 100644 --- a/src/process_wrap.cc +++ b/src/process_wrap.cc @@ -186,7 +186,7 @@ class ProcessWrap : public HandleWrap { Local<Value> argv_v = js_options->Get(context, env->args_string()).ToLocalChecked(); if (!argv_v.IsEmpty() && argv_v->IsArray()) { - Local<Array> js_argv = Local<Array>::Cast(argv_v); + Local<Array> js_argv = argv_v.As<Array>(); int argc = js_argv->Length(); CHECK_GT(argc + 1, 0); // Check for overflow. @@ -214,7 +214,7 @@ class ProcessWrap : public HandleWrap { Local<Value> env_v = js_options->Get(context, env->env_pairs_string()).ToLocalChecked(); if (!env_v.IsEmpty() && env_v->IsArray()) { - Local<Array> env_opt = Local<Array>::Cast(env_v); + Local<Array> env_opt = env_v.As<Array>(); int envc = env_opt->Length(); CHECK_GT(envc + 1, 0); // Check for overflow. options.env = new char*[envc + 1]; // Heap allocated to detect errors. |