| Index: src/debug.cc
|
| diff --git a/src/debug.cc b/src/debug.cc
|
| index f0e77968eb48fb6135ff9a8636a4dac6adbd18ad..720c06524d09a92fa3bbe037a4cab06ffb6c462f 100644
|
| --- a/src/debug.cc
|
| +++ b/src/debug.cc
|
| @@ -768,7 +768,8 @@ bool Debug::CompileDebuggerScript(Isolate* isolate, int index) {
|
| isolate->ComputeLocation(&computed_location);
|
| Handle<Object> message = MessageHandler::MakeMessageObject(
|
| isolate, "error_loading_debugger", &computed_location,
|
| - Vector<Handle<Object> >::empty(), Handle<JSArray>());
|
| + Vector<Handle<Object> >::empty(), Handle<JSObject>(),
|
| + Handle<JSArray>());
|
| DCHECK(!isolate->has_pending_exception());
|
| Handle<Object> exception;
|
| if (maybe_exception.ToHandle(&exception)) {
|
| @@ -1262,17 +1263,6 @@ bool Debug::IsBreakOnException(ExceptionBreakType type) {
|
| }
|
|
|
|
|
| -bool Debug::PromiseHasRejectHandler(Handle<JSObject> promise) {
|
| - Handle<JSFunction> fun = Handle<JSFunction>::cast(
|
| - JSObject::GetDataProperty(isolate_->js_builtins_object(),
|
| - isolate_->factory()->NewStringFromStaticChars(
|
| - "PromiseHasRejectHandler")));
|
| - Handle<Object> result =
|
| - Execution::Call(isolate_, fun, promise, 0, NULL).ToHandleChecked();
|
| - return result->IsTrue();
|
| -}
|
| -
|
| -
|
| void Debug::PrepareStep(StepAction step_action,
|
| int step_count,
|
| StackFrame::Id frame_id) {
|
| @@ -2501,7 +2491,8 @@ MaybeHandle<Object> Debug::MakeAsyncTaskEvent(Handle<JSObject> task_event) {
|
| }
|
|
|
|
|
| -void Debug::OnThrow(Handle<Object> exception, bool uncaught) {
|
| +void Debug::OnThrow(Handle<Object> exception, Handle<Object> promise,
|
| + bool uncaught) {
|
| if (in_debug_scope() || ignore_events()) return;
|
| // Temporarily clear any scheduled_exception to allow evaluating
|
| // JavaScript from the debug event handler.
|
| @@ -2511,7 +2502,7 @@ void Debug::OnThrow(Handle<Object> exception, bool uncaught) {
|
| scheduled_exception = handle(isolate_->scheduled_exception(), isolate_);
|
| isolate_->clear_scheduled_exception();
|
| }
|
| - OnException(exception, uncaught, isolate_->GetPromiseOnStackOnThrow());
|
| + OnException(exception, uncaught, promise);
|
| if (!scheduled_exception.is_null()) {
|
| isolate_->thread_local_top()->scheduled_exception_ = *scheduled_exception;
|
| }
|
| @@ -2527,8 +2518,12 @@ void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) {
|
|
|
| void Debug::OnException(Handle<Object> exception, bool uncaught,
|
| Handle<Object> promise) {
|
| - if (promise->IsJSObject()) {
|
| - uncaught |= !PromiseHasRejectHandler(Handle<JSObject>::cast(promise));
|
| + if (!uncaught && promise->IsJSObject()) {
|
| + Handle<Object> has_reject_handler;
|
| + ASSIGN_RETURN_ON_EXCEPTION_VALUE(
|
| + isolate_, has_reject_handler,
|
| + Execution::PromiseHasRejectHandler(isolate_, promise), /* void */);
|
| + uncaught = has_reject_handler->IsFalse();
|
| }
|
| // Bail out if exception breaks are not active
|
| if (uncaught) {
|
|
|