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 <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
apapirovski authored and evanlucas committed Jan 30, 2018
1 parent 799fd24 commit 3ab391d
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 @@ -1379,17 +1379,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 3ab391d

Please sign in to comment.