From 88d12c00da8e479261e88d6fcfe81c96b7dbd369 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 16 Jun 2020 13:18:42 +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/33902 Reviewed-By: Anna Henningsen Reviewed-By: Michaël Zasso Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- src/node_contextify.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_contextify.cc b/src/node_contextify.cc index b90b369d1b379c..5d44c2f76dd7a0 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1119,14 +1119,14 @@ void ContextifyContext::CompileFunction( context_extensions.size(), context_extensions.data(), options, v8::ScriptCompiler::NoCacheReason::kNoCacheNoReason, &script); - if (maybe_fn.IsEmpty()) { + Local fn; + if (!maybe_fn.ToLocal(&fn)) { if (try_catch.HasCaught() && !try_catch.HasTerminated()) { errors::DecorateErrorStack(env, try_catch); try_catch.ReThrow(); } return; } - Local fn = maybe_fn.ToLocalChecked(); Local cache_key; if (!env->compiled_fn_entry_template()->NewInstance(