Debugger: Re-add quotes to JS strings after editing

The quotes are stripped when the string is presented for editing, so
they have to be added back when we're done editing.

This is what we already did if we were talking to the inspector rather
than the V4 debugger.

In order for this to work, JS numbers need to be identified as numbers,
rather than strings. So, we have to add "number" to the types recognized
as float.

Change-Id: I2054f4ad36ec1d14fb2dfee3705a80c8ec84d5ac
Task-number: QTCREATORBUG-19032
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Ulf Hermann
2017-10-16 13:22:52 +02:00
parent 34d7b26a88
commit eeb0358d65
3 changed files with 6 additions and 6 deletions

View File

@@ -870,9 +870,13 @@ bool QmlEngine::canHandleToolTip(const DebuggerToolTipContext &) const
}
void QmlEngine::assignValueInDebugger(WatchItem *item,
const QString &expression, const QVariant &value)
const QString &expression, const QVariant &editValue)
{
if (!expression.isEmpty()) {
QVariant value = (editValue.type() == QVariant::String)
? QVariant('"' + editValue.toString().replace('"', "\\\"") + '"')
: editValue;
if (item->isInspect()) {
d->inspectorAgent.assignValue(item, expression, value);
} else {