Chromium Code Reviews| Index: Source/core/inspector/InjectedScriptBase.cpp |
| diff --git a/Source/core/inspector/InjectedScriptBase.cpp b/Source/core/inspector/InjectedScriptBase.cpp |
| index 243b0e111caa855d6bfc5a90091eaf26a102aeec..f0a8ae7dd9bc1d10e96431fcce69d5cf19e6dbe0 100644 |
| --- a/Source/core/inspector/InjectedScriptBase.cpp |
| +++ b/Source/core/inspector/InjectedScriptBase.cpp |
| @@ -39,6 +39,7 @@ |
| #include "platform/JSONValues.h" |
| #include "wtf/text/WTFString.h" |
| +using WebCore::TypeBuilder::Array; |
| using WebCore::TypeBuilder::Runtime::RemoteObject; |
| namespace WebCore { |
| @@ -121,7 +122,7 @@ void InjectedScriptBase::makeCall(ScriptFunctionCall& function, RefPtr<JSONValue |
| } |
| } |
| -void InjectedScriptBase::makeEvalCall(ErrorString* errorString, ScriptFunctionCall& function, RefPtr<TypeBuilder::Runtime::RemoteObject>* objectResult, TypeBuilder::OptOutput<bool>* wasThrown) |
| +void InjectedScriptBase::makeEvalCall(ErrorString* errorString, ScriptFunctionCall& function, RefPtr<TypeBuilder::Runtime::RemoteObject>* objectResult, TypeBuilder::OptOutput<bool>* wasThrown, RefPtr<TypeBuilder::Debugger::ExceptionDetails>* objectExceptionDetails) |
| { |
| RefPtr<JSONValue> result; |
| makeCall(function, &result); |
| @@ -145,6 +146,28 @@ void InjectedScriptBase::makeEvalCall(ErrorString* errorString, ScriptFunctionCa |
| *errorString = "Internal error: result is not a pair of value and wasThrown flag"; |
| return; |
| } |
| + if (wasThrownVal) { |
| + RefPtr<JSONObject> exceptionDetails = resultPair->getObject("exceptionDetails"); |
|
aandrey
2014/07/04 16:57:25
so, where is it coming from? did you forget to add
|
| + if (objectExceptionDetails && exceptionDetails) { |
| + String exceptionDetailsText; |
| + if (exceptionDetails->getString("text", &exceptionDetailsText)) { |
| + RefPtr<TypeBuilder::Debugger::ExceptionDetails> outputExceptionDetails = TypeBuilder::Debugger::ExceptionDetails::create().setText(exceptionDetailsText); |
| + String url; |
| + if (exceptionDetails->getString("url", &url)) |
| + outputExceptionDetails->setUrl(url); |
| + int line = 0; |
| + if (exceptionDetails->getNumber("line", &line)) |
| + outputExceptionDetails->setLine(line); |
| + int column = 0; |
| + if (exceptionDetails->getNumber("column", &column)) |
| + outputExceptionDetails->setColumn(column); |
| + RefPtr<JSONArray> stackTrace = exceptionDetails->getArray("stackTrace"); |
| + if (stackTrace && stackTrace->length() > 0) |
| + outputExceptionDetails->setStackTrace(Array<TypeBuilder::Console::CallFrame>::runtimeCast(stackTrace)); |
| + *objectExceptionDetails = outputExceptionDetails; |
| + } |
| + } |
| + } |
| *objectResult = TypeBuilder::Runtime::RemoteObject::runtimeCast(resultObj); |
| *wasThrown = wasThrownVal; |
| } |