Chromium Code Reviews| Index: src/debug.cc |
| diff --git a/src/debug.cc b/src/debug.cc |
| index 03c91979e929e2bd3be49e9e6abfd30e78d04023..b30ab3881ac2dd3144cd62758177a6f5d25be444 100644 |
| --- a/src/debug.cc |
| +++ b/src/debug.cc |
| @@ -2618,6 +2618,24 @@ void Debug::OnException(Handle<Object> exception, bool uncaught) { |
| } |
| +void Debug::OnCompileError(Handle<Script> script) { |
| + // No more to do if not debugging. |
| + if (in_debug_scope() || ignore_events()) return; |
| + |
| + HandleScope scope(isolate_); |
| + DebugScope debug_scope(this); |
| + if (debug_scope.failed()) return; |
| + |
| + // Create the compile state object. |
| + Handle<Object> event_data; |
| + // Bail out and don't call debugger if exception. |
| + if (!MakeCompileEvent(script, false).ToHandle(&event_data)) return; |
| + |
| + // Process debug event. |
| + ProcessDebugEvent(v8::CompileError, Handle<JSObject>::cast(event_data), true); |
| +} |
| + |
| + |
| void Debug::OnDebugBreak(Handle<Object> break_points_hit, |
| bool auto_continue) { |
| // The caller provided for DebugScope. |
| @@ -2658,8 +2676,7 @@ void Debug::OnBeforeCompile(Handle<Script> script) { |
| // Handle debugger actions when a new script is compiled. |
| -void Debug::OnAfterCompile(Handle<Script> script, |
| - AfterCompileFlags after_compile_flags) { |
| +void Debug::OnAfterCompile(Handle<Script> script) { |
| // Add the newly compiled script to the script cache. |
| if (script_cache_ != NULL) script_cache_->Add(script); |
| @@ -2667,9 +2684,6 @@ void Debug::OnAfterCompile(Handle<Script> script, |
| if (in_debug_scope() || ignore_events()) return; |
| HandleScope scope(isolate_); |
| - // Store whether in debugger before entering debugger. |
| - bool was_in_scope = in_debug_scope(); |
| - |
| DebugScope debug_scope(this); |
| if (debug_scope.failed()) return; |
| @@ -2701,8 +2715,6 @@ void Debug::OnAfterCompile(Handle<Script> script, |
| argv).is_null()) { |
| return; |
| } |
| - // Bail out based on state or if there is no listener for this event |
| - if (was_in_scope && (after_compile_flags & SEND_WHEN_DEBUGGING) == 0) return; |
|
Yang
2014/06/11 14:33:37
Is it guaranteed that when this method is called f
|
| // Create the compile state object. |
| Handle<Object> event_data; |