Skip to content

Commit

Permalink
src: remove unnecessary block scope
Browse files Browse the repository at this point in the history
PR-URL: #18291
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
apapirovski committed Jan 29, 2018
1 parent 46e0a55 commit 7d3a302
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1066,17 +1066,13 @@ MaybeLocal<Value> InternalMakeCallback(Environment* env,
return Undefined(env->isolate());
}

MaybeLocal<Value> ret;
MaybeLocal<Value> 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();
Expand Down

0 comments on commit 7d3a302

Please sign in to comment.