Chromium Code Reviews| Index: src/debug/debug.cc |
| diff --git a/src/debug/debug.cc b/src/debug/debug.cc |
| index 418b8eb2481d84020a22a43658aabed70412edd3..0a4a8ad64823ccef4e944f680655269999e8af5d 100644 |
| --- a/src/debug/debug.cc |
| +++ b/src/debug/debug.cc |
| @@ -1746,6 +1746,21 @@ v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) { |
| } |
| } // anonymous namespace |
| +bool Debug::IsExceptionBlackboxed(bool uncaught) { |
| + JavaScriptFrameIterator it(isolate_); |
| + if (it.done()) return false; |
| + // Uncaught exception is blackboxed if all current frames are blackboxed, |
| + // caught exception if top frame is blackboxed. |
| + bool is_top_frame_blackboxed = IsBlackboxed(it.frame()->function()->shared()); |
|
Yang
2017/01/25 10:10:15
This doesn't account for inlined frames. Please us
kozy
2017/01/25 17:39:26
Done + added a test.
|
| + if (!uncaught || !is_top_frame_blackboxed) return is_top_frame_blackboxed; |
| + it.Advance(); |
| + while (!it.done()) { |
| + if (!IsBlackboxed(it.frame()->function()->shared())) return false; |
| + it.Advance(); |
| + } |
| + return true; |
| +} |
| + |
| void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
| // We cannot generate debug events when JS execution is disallowed. |
| // TODO(5530): Reenable debug events within DisallowJSScopes once relevant |
| @@ -1778,8 +1793,8 @@ void Debug::OnException(Handle<Object> exception, Handle<Object> promise) { |
| { |
| JavaScriptFrameIterator it(isolate_); |
| // Check whether the top frame is blackboxed or the break location is muted. |
| - if (!it.done() && (IsBlackboxed(it.frame()->function()->shared()) || |
| - IsMutedAtCurrentLocation(it.frame()))) { |
| + if (!it.done() && (IsMutedAtCurrentLocation(it.frame()) || |
| + IsExceptionBlackboxed(uncaught))) { |
| return; |
| } |
| } |