OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/debug/debug.h" | 5 #include "src/debug/debug.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1715 | 1715 |
1716 | 1716 |
1717 MaybeHandle<Object> Debug::PromiseHasUserDefinedRejectHandler( | 1717 MaybeHandle<Object> Debug::PromiseHasUserDefinedRejectHandler( |
1718 Handle<JSObject> promise) { | 1718 Handle<JSObject> promise) { |
1719 Handle<JSFunction> fun = isolate_->promise_has_user_defined_reject_handler(); | 1719 Handle<JSFunction> fun = isolate_->promise_has_user_defined_reject_handler(); |
1720 return Execution::Call(isolate_, fun, promise, 0, NULL); | 1720 return Execution::Call(isolate_, fun, promise, 0, NULL); |
1721 } | 1721 } |
1722 | 1722 |
1723 | 1723 |
1724 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { | 1724 void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
1725 // In our prediction, try-finally is not considered to catch. | |
1726 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); | 1725 Isolate::CatchType catch_type = isolate_->PredictExceptionCatcher(); |
| 1726 |
| 1727 // Don't notify listener of exceptions that are internal to a desugaring. |
| 1728 if (catch_type == Isolate::CAUGHT_BY_DESUGARING) return; |
| 1729 |
1727 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); | 1730 bool uncaught = (catch_type == Isolate::NOT_CAUGHT); |
1728 if (promise->IsJSObject()) { | 1731 if (promise->IsJSObject()) { |
1729 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); | 1732 Handle<JSObject> jspromise = Handle<JSObject>::cast(promise); |
1730 // Mark the promise as already having triggered a message. | 1733 // Mark the promise as already having triggered a message. |
1731 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); | 1734 Handle<Symbol> key = isolate_->factory()->promise_debug_marker_symbol(); |
1732 JSObject::SetProperty(jspromise, key, key, STRICT).Assert(); | 1735 JSObject::SetProperty(jspromise, key, key, STRICT).Assert(); |
1733 // Check whether the promise reject is considered an uncaught exception. | 1736 // Check whether the promise reject is considered an uncaught exception. |
1734 Handle<Object> has_reject_handler; | 1737 Handle<Object> has_reject_handler; |
1735 ASSIGN_RETURN_ON_EXCEPTION_VALUE( | 1738 ASSIGN_RETURN_ON_EXCEPTION_VALUE( |
1736 isolate_, has_reject_handler, | 1739 isolate_, has_reject_handler, |
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2574 } | 2577 } |
2575 | 2578 |
2576 | 2579 |
2577 void LockingCommandMessageQueue::Clear() { | 2580 void LockingCommandMessageQueue::Clear() { |
2578 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2581 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2579 queue_.Clear(); | 2582 queue_.Clear(); |
2580 } | 2583 } |
2581 | 2584 |
2582 } // namespace internal | 2585 } // namespace internal |
2583 } // namespace v8 | 2586 } // namespace v8 |
OLD | NEW |