From 0814b3061bd30062db5a74c747c50ebc919ed0be Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 8 May 2020 15:20:03 +0200 Subject: [PATCH] src: use MaybeLocal.ToLocal instead of IsEmpty This commit suggest using MaybeLocal.ToLocal and passing in the Local fn. The motivation for doing this is that the following MaybeLocal.ToLocalChecked call can then be avoided. --- src/node.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node.cc b/src/node.cc index 240f1f2e3b00f3..5a10addcef8615 100644 --- a/src/node.cc +++ b/src/node.cc @@ -171,11 +171,11 @@ MaybeLocal ExecuteBootstrapper(Environment* env, MaybeLocal maybe_fn = NativeModuleEnv::LookupAndCompile(env->context(), id, parameters, env); - if (maybe_fn.IsEmpty()) { + Local fn; + if (!maybe_fn.ToLocal(&fn)) { return MaybeLocal(); } - Local fn = maybe_fn.ToLocalChecked(); MaybeLocal result = fn->Call(env->context(), Undefined(env->isolate()), arguments->size(),