Commit 727dd1b1 authored by Aurindam Jana's avatar Aurindam Jana
Browse files

QmlV8DebuggerClient: Evaluate Expression



V8 engine may return an anonymous event for Evaluation of an expression
instead of a response, if the expression has syntax error. This fix
handles this particular case.

Change-Id: Ic89252b04eb4d6f7e6b0b2e03067f031f1f446ed
Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent bd0b030c
......@@ -1235,6 +1235,22 @@ void QmlV8DebuggerClient::messageReceived(const QByteArray &data)
d->requestListBreakpoints = true;
}
//Sometimes we do not get event type!
//This is most probably due to a wrong eval expression.
//Redirect output to console.
if (eventType.isEmpty()) {
bool success = resp.value(_("success")).toBool();
QVariantMap map;
map.insert(_(TYPE), QVariant(_("string")));
map.insert(_(VALUE), resp.value(_("message")));
//Since there is no sequence value, best estimate is
//last sequence value
updateEvaluationResult(d->sequence, success, QVariant(map), QVariant());
if (!isV8Running
&& d->debugServiceState == QmlV8DebuggerClient::ProcessingRequestState)
d->debugServiceState = QmlV8DebuggerClient::WaitingForRequestState;
}
if (!isV8Running
&& d->debugServiceState == QmlV8DebuggerClient::RunningState)
d->debugServiceState = QmlV8DebuggerClient::WaitingForRequestState;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment