From 6014e4e0b8411672ef33252f9d7f5fa45c1e135b 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 536d761c637928..4dcb65bd85a0eb 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -1122,14 +1122,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(