From c2f49319b7dfcdf5e203dae0ed4a50fb84e0147a Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 1 Jun 2020 14:36:40 +0200 Subject: [PATCH] src: remove unnecessary ToLocalChecked call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/33683 Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: David Carlier Reviewed-By: Benjamin Gruenbaum Reviewed-By: Juan José Arboleda --- src/node_native_module_env.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/node_native_module_env.cc b/src/node_native_module_env.cc index ae8d349541b912..a3a42a3ec4b9a6 100644 --- a/src/node_native_module_env.cc +++ b/src/node_native_module_env.cc @@ -131,8 +131,9 @@ void NativeModuleEnv::CompileFunction(const FunctionCallbackInfo& args) { NativeModuleLoader::GetInstance()->CompileAsModule( env->context(), id, &result); RecordResult(id, result, env); - if (!maybe.IsEmpty()) { - args.GetReturnValue().Set(maybe.ToLocalChecked()); + Local fn; + if (maybe.ToLocal(&fn)) { + args.GetReturnValue().Set(fn); } }