Skip to content

Commit

Permalink
src: remove unnecessary ToLocalChecked call
Browse files Browse the repository at this point in the history
PR-URL: #33683
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
  • Loading branch information
danbev committed Jun 5, 2020
1 parent 641c466 commit 9027f5f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/node_native_module_env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ void NativeModuleEnv::CompileFunction(const FunctionCallbackInfo<Value>& args) {
NativeModuleLoader::GetInstance()->CompileAsModule(
env->context(), id, &result);
RecordResult(id, result, env);
if (!maybe.IsEmpty()) {
args.GetReturnValue().Set(maybe.ToLocalChecked());
Local<Function> fn;
if (maybe.ToLocal(&fn)) {
args.GetReturnValue().Set(fn);
}
}

Expand Down

0 comments on commit 9027f5f

Please sign in to comment.