OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
485 preprocessBeforeCompile(eventDetails); | 485 preprocessBeforeCompile(eventDetails); |
486 } else if (event == v8::AfterCompile || event == v8::CompileError) { | 486 } else if (event == v8::AfterCompile || event == v8::CompileError) { |
487 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); | 487 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); |
488 v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Funct
ion>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getAfterCompileScript"
))); | 488 v8::Handle<v8::Function> getAfterCompileScript = v8::Local<v8::Funct
ion>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getAfterCompileScript"
))); |
489 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; | 489 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; |
490 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); | 490 v8::Handle<v8::Value> value = V8ScriptRunner::callInternalFunction(g
etAfterCompileScript, debuggerScript, WTF_ARRAY_LENGTH(argv), argv, m_isolate); |
491 ASSERT(value->IsObject()); | 491 ASSERT(value->IsObject()); |
492 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); | 492 v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(value); |
493 dispatchDidParseSource(listener, object, event != v8::AfterCompile ?
CompileError : CompileSuccess); | 493 dispatchDidParseSource(listener, object, event != v8::AfterCompile ?
CompileError : CompileSuccess); |
494 } else if (event == v8::Exception) { | 494 } else if (event == v8::Exception) { |
495 v8::Local<v8::StackTrace> stackTrace = v8::StackTrace::CurrentStackT
race(m_isolate, 1); | |
496 // Stack trace is empty in case of syntax error. Silently continue e
xecution in such cases. | |
497 if (!stackTrace->GetFrameCount()) | |
498 return; | |
499 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); | 495 v8::Handle<v8::Object> eventData = eventDetails.GetEventData(); |
500 v8::Handle<v8::Value> exception = callInternalGetterFunction(eventDa
ta, "exception", m_isolate); | 496 v8::Handle<v8::Value> exception = callInternalGetterFunction(eventDa
ta, "exception", m_isolate); |
501 handleProgramBreak(ScriptState::from(eventContext), eventDetails.Get
ExecutionState(), exception, v8::Handle<v8::Array>()); | 497 handleProgramBreak(ScriptState::from(eventContext), eventDetails.Get
ExecutionState(), exception, v8::Handle<v8::Array>()); |
502 } else if (event == v8::Break) { | 498 } else if (event == v8::Break) { |
503 v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8
::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getBreakpointNu
mbers"))); | 499 v8::Handle<v8::Function> getBreakpointNumbersFunction = v8::Local<v8
::Function>::Cast(debuggerScript->Get(v8AtomicString(m_isolate, "getBreakpointNu
mbers"))); |
504 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; | 500 v8::Handle<v8::Value> argv[] = { eventDetails.GetEventData() }; |
505 v8::Handle<v8::Value> hitBreakpoints = V8ScriptRunner::callInternalF
unction(getBreakpointNumbersFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), ar
gv, m_isolate); | 501 v8::Handle<v8::Value> hitBreakpoints = V8ScriptRunner::callInternalF
unction(getBreakpointNumbersFunction, debuggerScript, WTF_ARRAY_LENGTH(argv), ar
gv, m_isolate); |
506 ASSERT(hitBreakpoints->IsArray()); | 502 ASSERT(hitBreakpoints->IsArray()); |
507 handleProgramBreak(ScriptState::from(eventContext), eventDetails.Get
ExecutionState(), v8::Handle<v8::Value>(), hitBreakpoints.As<v8::Array>()); | 503 handleProgramBreak(ScriptState::from(eventContext), eventDetails.Get
ExecutionState(), v8::Handle<v8::Value>(), hitBreakpoints.As<v8::Array>()); |
508 } else if (event == v8::AsyncTaskEvent) { | 504 } else if (event == v8::AsyncTaskEvent) { |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 { | 672 { |
677 return PassOwnPtr<ScriptSourceCode>(); | 673 return PassOwnPtr<ScriptSourceCode>(); |
678 } | 674 } |
679 | 675 |
680 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) | 676 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou
rce, const String& url, const String& functionName) |
681 { | 677 { |
682 return source; | 678 return source; |
683 } | 679 } |
684 | 680 |
685 } // namespace blink | 681 } // namespace blink |
OLD | NEW |