Chromium Code Reviews| Index: src/debug.cc |
| diff --git a/src/debug.cc b/src/debug.cc |
| index f0e77968eb48fb6135ff9a8636a4dac6adbd18ad..330eeb737400b026d34de19b3aca0d3d1bffaa23 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; |
| } |
| @@ -2528,7 +2519,11 @@ void Debug::OnPromiseReject(Handle<JSObject> promise, Handle<Object> value) { |
| void Debug::OnException(Handle<Object> exception, bool uncaught, |
| Handle<Object> promise) { |
| if (promise->IsJSObject()) { |
|
aandrey
2014/09/26 14:58:46
can it be "if (!uncaught && promise->IsJSObject())
Yang
2014/09/26 15:04:42
Done.
I agree. The side effect is now gone. We ma
|
| - uncaught |= !PromiseHasRejectHandler(Handle<JSObject>::cast(promise)); |
| + 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) { |