diff --git a/src/node.cc b/src/node.cc index def2b6148776aa..980272842a3439 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1379,17 +1379,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();