diff options
author | Sam Roberts <vieuxtech@gmail.com> | 2019-04-10 01:21:36 +0300 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-04-12 22:33:37 +0300 |
commit | 060d901f87b3d87314f8540eb02f315e2952f581 (patch) | |
tree | 53159171201703bb6d8a4e780c8624a5c6c8cbb5 /src/node_task_queue.cc | |
parent | 7b0d8673898e65a368108264c77bccaa3e004028 (diff) |
src: replace FromJust() with Check() when possible
FromJust() is often used not for its return value, but for its
side-effects. In these cases, Check() exists, and is more clear as to
the intent. From its comment:
To be used, where the actual value of the Maybe is not needed, like
Object::Set.
See: https://github.com/nodejs/node/pull/26929/files#r269256335
PR-URL: https://github.com/nodejs/node/pull/27162
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'src/node_task_queue.cc')
-rw-r--r-- | src/node_task_queue.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc index 64709f531d7..b14c806dec0 100644 --- a/src/node_task_queue.cc +++ b/src/node_task_queue.cc @@ -131,7 +131,7 @@ static void Initialize(Local<Object> target, env->SetMethod(target, "runMicrotasks", RunMicrotasks); target->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "tickInfo"), - env->tick_info()->fields().GetJSArray()).FromJust(); + env->tick_info()->fields().GetJSArray()).Check(); Local<Object> events = Object::New(isolate); NODE_DEFINE_CONSTANT(events, kPromiseRejectWithNoHandler); @@ -141,7 +141,7 @@ static void Initialize(Local<Object> target, target->Set(env->context(), FIXED_ONE_BYTE_STRING(isolate, "promiseRejectEvents"), - events).FromJust(); + events).Check(); env->SetMethod(target, "setPromiseRejectCallback", SetPromiseRejectCallback); |