diff --git a/src/node_errors.cc b/src/node_errors.cc index 0ec100986e8799..c69ced947a4e33 100644 --- a/src/node_errors.cc +++ b/src/node_errors.cc @@ -945,7 +945,7 @@ void TriggerUncaughtException(Isolate* isolate, return; } - MaybeLocal handled; + MaybeLocal maybe_handled; if (env->can_call_into_js()) { // We do not expect the global uncaught exception itself to throw any more // exceptions. If it does, exit the current Node.js instance. @@ -959,7 +959,7 @@ void TriggerUncaughtException(Isolate* isolate, Local argv[2] = { error, Boolean::New(env->isolate(), from_promise) }; - handled = fatal_exception_function.As()->Call( + maybe_handled = fatal_exception_function.As()->Call( env->context(), process_object, arraysize(argv), argv); } @@ -967,7 +967,8 @@ void TriggerUncaughtException(Isolate* isolate, // instance so return to continue the exit routine. // TODO(joyeecheung): return a Maybe here to prevent the caller from // stepping on the exit. - if (handled.IsEmpty()) { + Local handled; + if (!maybe_handled.ToLocal(&handled)) { return; } @@ -977,7 +978,7 @@ void TriggerUncaughtException(Isolate* isolate, // TODO(joyeecheung): This has been only checking that the return value is // exactly false. Investigate whether this can be turned to an "if true" // similar to how the worker global uncaught exception handler handles it. - if (!handled.ToLocalChecked()->IsFalse()) { + if (!handled->IsFalse()) { return; }