Index: Source/bindings/v8/ScriptDebugServer.cpp |
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp |
index 48bf330a72f98416d56ca2daa2b849af86c5c5a2..380d4cac342e65d503a8a7b9a60abcf1f3b01534 100644 |
--- a/Source/bindings/v8/ScriptDebugServer.cpp |
+++ b/Source/bindings/v8/ScriptDebugServer.cpp |
@@ -34,6 +34,7 @@ |
#include "DebuggerScriptSource.h" |
#include "V8JavaScriptCallFrame.h" |
#include "bindings/v8/ScopedPersistent.h" |
+#include "bindings/v8/ScriptCallStackFactory.h" |
#include "bindings/v8/ScriptController.h" |
#include "bindings/v8/ScriptObject.h" |
#include "bindings/v8/ScriptSourceCode.h" |
@@ -600,7 +601,7 @@ bool ScriptDebugServer::isPaused() |
return !m_executionState.isEmpty(); |
} |
-void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage) |
+void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& expression, const String& sourceURL, String* scriptId, String* exceptionMessage, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) |
{ |
if (scriptState->contextIsEmpty()) |
return; |
@@ -611,8 +612,15 @@ void ScriptDebugServer::compileScript(ScriptState* scriptState, const String& ex |
v8::Local<v8::Script> script = V8ScriptRunner::compileScript(source, sourceURL, TextPosition(), 0, m_isolate); |
if (tryCatch.HasCaught()) { |
v8::Local<v8::Message> message = tryCatch.Message(); |
- if (!message.IsEmpty()) |
+ if (!message.IsEmpty()) { |
*exceptionMessage = toCoreStringWithUndefinedOrNullCheck(message->Get()); |
+ if (lineNumber) |
vsevik
2014/05/19 12:40:23
This won't be needed once default parameters are r
|
+ *lineNumber = message->GetLineNumber(); |
vsevik
2014/05/19 12:40:23
extra space
|
+ if (columnNumber) |
+ *columnNumber = message->GetStartColumn(); |
+ if (stackTrace) |
+ *stackTrace = createScriptCallStack(message->GetStackTrace(), ScriptCallStack::maxCallStackSizeToCapture, m_isolate); |
+ } |
return; |
} |
if (script.IsEmpty()) |
@@ -627,7 +635,7 @@ void ScriptDebugServer::clearCompiledScripts() |
m_compiledScripts.clear(); |
} |
-void ScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage) |
+void ScriptDebugServer::runScript(ScriptState* scriptState, const String& scriptId, ScriptValue* result, bool* wasThrown, String* exceptionMessage, int* lineNumber, int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) |
{ |
if (!m_compiledScripts.contains(scriptId)) |
return; |
@@ -648,8 +656,15 @@ void ScriptDebugServer::runScript(ScriptState* scriptState, const String& script |
*wasThrown = true; |
*result = ScriptValue(scriptState, tryCatch.Exception()); |
v8::Local<v8::Message> message = tryCatch.Message(); |
- if (!message.IsEmpty()) |
+ if (!message.IsEmpty()) { |
*exceptionMessage = toCoreStringWithUndefinedOrNullCheck(message->Get()); |
+ if (lineNumber) |
+ *lineNumber = message->GetLineNumber(); |
vsevik
2014/05/19 12:40:23
ditto
|
+ if (columnNumber) |
+ *columnNumber = message->GetStartColumn(); |
+ if (stackTrace) |
+ *stackTrace = createScriptCallStack(message->GetStackTrace(), ScriptCallStack::maxCallStackSizeToCapture, m_isolate); |
+ } |
} else { |
*result = ScriptValue(scriptState, value); |
} |