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/module_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/module_wrap.cc')
-rw-r--r-- | src/module_wrap.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/module_wrap.cc b/src/module_wrap.cc index f45ee7627b0..f3ea419df1e 100644 --- a/src/module_wrap.cc +++ b/src/module_wrap.cc @@ -292,8 +292,8 @@ void ModuleWrap::Link(const FunctionCallbackInfo<Value>& args) { for (int i = 0; i < raw_assertions->Length(); i += 3) { assertions ->Set(env->context(), - Local<String>::Cast(raw_assertions->Get(env->context(), i)), - Local<Value>::Cast(raw_assertions->Get(env->context(), i + 1))) + raw_assertions->Get(env->context(), i).As<String>(), + raw_assertions->Get(env->context(), i + 1).As<Value>()) .ToChecked(); } |