src: remove unnecessary ToLocalChecked call

PR-URL: https://github.com/nodejs/node/pull/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>
This commit is contained in:
Daniel Bevenius
2020-06-01 14:36:40 +02:00
parent 641c466671
commit 9027f5fdbe

View File

@@ -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);
}
}