diff --git a/src/node.cc b/src/node.cc index 656d132ec9fb32..dd6a44bbae3ee0 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1066,17 +1066,13 @@ MaybeLocal InternalMakeCallback(Environment* env, return Undefined(env->isolate()); } - MaybeLocal ret; + MaybeLocal ret = callback->Call(env->context(), recv, argc, argv); - { - ret = callback->Call(env->context(), recv, argc, argv); - - if (ret.IsEmpty()) { - // NOTE: For backwards compatibility with public API we return Undefined() - // if the top level call threw. - scope.MarkAsFailed(); - return scope.IsInnerMakeCallback() ? ret : Undefined(env->isolate()); - } + if (ret.IsEmpty()) { + // NOTE: For backwards compatibility with public API we return Undefined() + // if the top level call threw. + scope.MarkAsFailed(); + return scope.IsInnerMakeCallback() ? ret : Undefined(env->isolate()); } scope.Close();