Index: Source/bindings/v8/ScriptDebugServer.cpp |
diff --git a/Source/bindings/v8/ScriptDebugServer.cpp b/Source/bindings/v8/ScriptDebugServer.cpp |
index 11b48147d0ee3924ece7c3c9c4a8d2bfa450917e..157000c4b4a6d5ba7ec251556f0a2f139fa16b1d 100644 |
--- a/Source/bindings/v8/ScriptDebugServer.cpp |
+++ b/Source/bindings/v8/ScriptDebugServer.cpp |
@@ -298,13 +298,23 @@ bool ScriptDebugServer::setScriptSource(const String& sourceID, const String& ne |
// Compile error. |
case 1: |
{ |
+ V8StringResource<WithUndefinedOrNullCheck> message(resultTuple->Get(2)); |
+ if (!message.prepare()) { |
+ *error = "Unknown error."; |
+ return false; |
+ } |
RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> compileError = |
TypeBuilder::Debugger::SetScriptSourceError::CompileError::create() |
- .setMessage(toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(2))) |
+ .setMessage(message) |
.setLineNumber(resultTuple->Get(3)->ToInteger()->Value()) |
.setColumnNumber(resultTuple->Get(4)->ToInteger()->Value()); |
- *error = toWebCoreStringWithUndefinedOrNullCheck(resultTuple->Get(1)); |
+ V8StringResource<WithUndefinedOrNullCheck> errorResource(resultTuple->Get(1)); |
+ if (!errorResource.prepare()) { |
+ *error = "Unknown error."; |
+ return false; |
+ } |
+ *error = errorResource; |
errorData = TypeBuilder::Debugger::SetScriptSourceError::create(); |
errorData->setCompileError(compileError); |
return false; |
@@ -384,8 +394,10 @@ void ScriptDebugServer::handleProgramBreak(v8::Handle<v8::Object> executionState |
Vector<String> breakpointIds; |
if (!hitBreakpointNumbers.IsEmpty()) { |
breakpointIds.resize(hitBreakpointNumbers->Length()); |
- for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) |
- breakpointIds[i] = toWebCoreStringWithUndefinedOrNullCheck(hitBreakpointNumbers->Get(i)); |
+ for (size_t i = 0; i < hitBreakpointNumbers->Length(); i++) { |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, hitBreakpointNumber, hitBreakpointNumbers->Get(i)); |
+ breakpointIds[i] = hitBreakpointNumber; |
+ } |
} |
m_executionState.set(m_isolate, executionState); |
@@ -489,12 +501,15 @@ void ScriptDebugServer::handleV8DebugEvent(const v8::Debug::EventDetails& eventD |
void ScriptDebugServer::dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Object> object) |
{ |
- String sourceID = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "id"))); |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, sourceID, object->Get(v8AtomicString(m_isolate, "id"))); |
ScriptDebugListener::Script script; |
- script.url = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "name"))); |
- script.source = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "source"))); |
- script.sourceMappingURL = toWebCoreStringWithUndefinedOrNullCheck(object->Get(v8AtomicString(m_isolate, "sourceMappingURL"))); |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, url, object->Get(v8AtomicString(m_isolate, "name"))); |
+ script.url = url; |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, source, object->Get(v8AtomicString(m_isolate, "source"))); |
+ script.source = source; |
+ V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithUndefinedOrNullCheck>, sourceMappingURL, object->Get(v8AtomicString(m_isolate, "sourceMappingURL"))); |
+ script.sourceMappingURL = sourceMappingURL; |
script.startLine = object->Get(v8AtomicString(m_isolate, "startLine"))->ToInteger()->Value(); |
script.startColumn = object->Get(v8AtomicString(m_isolate, "startColumn"))->ToInteger()->Value(); |
script.endLine = object->Get(v8AtomicString(m_isolate, "endLine"))->ToInteger()->Value(); |