Index: src/debug/debug.cc |
diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
index e04695771bf1f1c7755832ad10c240853a56ad6a..6e9322473d68f1b9b08e3016942f3575db190f41 100644 |
--- a/src/debug/debug.cc |
+++ b/src/debug/debug.cc |
@@ -1693,31 +1693,21 @@ void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { |
} |
-MaybeHandle<Object> Debug::PromiseHasUserDefinedRejectHandler( |
- Handle<JSObject> promise) { |
- Handle<JSFunction> fun = isolate_->promise_has_user_defined_reject_handler(); |
- return Execution::Call(isolate_, fun, promise, 0, NULL); |
-} |
- |
- |
void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); |
// Don't notify listener of exceptions that are internal to a desugaring. |
if (catch_type == Isolate::CAUGHT_BY_DESUGARING) return; |
- bool uncaught = (catch_type == Isolate::NOT_CAUGHT); |
- if (promise->IsJSObject()) { |
+ bool uncaught = (catch_type == Isolate::NOT_CAUGHT || |
+ catch_type == Isolate::CAUGHT_BY_ASYNC_AWAIT); |
+ if (catch_type != Isolate::CAUGHT_BY_JAVASCRIPT && promise->IsJSObject()) { |
Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); |
// Mark the promise as already having triggered a message. |
Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); |
JSObject::SetProperty(jspromise, key, key, STRICT).Assert(); |
// Check whether the promise reject is considered an uncaught exception. |
- Handle<Object> has_reject_handler; |
- ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
- isolate_, has_reject_handler, |
- PromiseHasUserDefinedRejectHandler(jspromise), /* void */); |
- uncaught = has_reject_handler->IsFalse(isolate_); |
+ uncaught = !isolate_->PromiseHasUserDefinedRejectHandler(jspromise); |
} |
// Bail out if exception breaks are not active |
if (uncaught) { |