@@ -954,7 +954,7 @@ void TriggerUncaughtException(Isolate* isolate,
954954 return ;
955955 }
956956
957- MaybeLocal<Value> handled ;
957+ MaybeLocal<Value> maybe_handled ;
958958 if (env->can_call_into_js ()) {
959959 // We do not expect the global uncaught exception itself to throw any more
960960 // exceptions. If it does, exit the current Node.js instance.
@@ -968,15 +968,16 @@ void TriggerUncaughtException(Isolate* isolate,
968968 Local<Value> argv[2 ] = { error,
969969 Boolean::New (env->isolate (), from_promise) };
970970
971- handled = fatal_exception_function.As <Function>()->Call (
971+ maybe_handled = fatal_exception_function.As <Function>()->Call (
972972 env->context (), process_object, arraysize (argv), argv);
973973 }
974974
975975 // If process._fatalException() throws, we are now exiting the Node.js
976976 // instance so return to continue the exit routine.
977977 // TODO(joyeecheung): return a Maybe here to prevent the caller from
978978 // stepping on the exit.
979- if (handled.IsEmpty ()) {
979+ Local<Value> handled;
980+ if (!maybe_handled.ToLocal (&handled)) {
980981 return ;
981982 }
982983
@@ -986,7 +987,7 @@ void TriggerUncaughtException(Isolate* isolate,
986987 // TODO(joyeecheung): This has been only checking that the return value is
987988 // exactly false. Investigate whether this can be turned to an "if true"
988989 // similar to how the worker global uncaught exception handler handles it.
989- if (!handled. ToLocalChecked () ->IsFalse ()) {
990+ if (!handled->IsFalse ()) {
990991 return ;
991992 }
992993
0 commit comments