Skip to content

Commit c308b06

Browse files
danbevtargos
authored andcommitted
src: remove unnecessary ToLocalChecked node_errors
PR-URL: #36547 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 5ac21bc commit c308b06

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/node_errors.cc

+5-4
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ void TriggerUncaughtException(Isolate* isolate,
945945
return;
946946
}
947947

948-
MaybeLocal<Value> handled;
948+
MaybeLocal<Value> maybe_handled;
949949
if (env->can_call_into_js()) {
950950
// We do not expect the global uncaught exception itself to throw any more
951951
// exceptions. If it does, exit the current Node.js instance.
@@ -959,15 +959,16 @@ void TriggerUncaughtException(Isolate* isolate,
959959
Local<Value> argv[2] = { error,
960960
Boolean::New(env->isolate(), from_promise) };
961961

962-
handled = fatal_exception_function.As<Function>()->Call(
962+
maybe_handled = fatal_exception_function.As<Function>()->Call(
963963
env->context(), process_object, arraysize(argv), argv);
964964
}
965965

966966
// If process._fatalException() throws, we are now exiting the Node.js
967967
// instance so return to continue the exit routine.
968968
// TODO(joyeecheung): return a Maybe here to prevent the caller from
969969
// stepping on the exit.
970-
if (handled.IsEmpty()) {
970+
Local<Value> handled;
971+
if (!maybe_handled.ToLocal(&handled)) {
971972
return;
972973
}
973974

@@ -977,7 +978,7 @@ void TriggerUncaughtException(Isolate* isolate,
977978
// TODO(joyeecheung): This has been only checking that the return value is
978979
// exactly false. Investigate whether this can be turned to an "if true"
979980
// similar to how the worker global uncaught exception handler handles it.
980-
if (!handled.ToLocalChecked()->IsFalse()) {
981+
if (!handled->IsFalse()) {
981982
return;
982983
}
983984

0 commit comments

Comments
 (0)