diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-12-20 14:08:12 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-12-20 13:45:52 +0000 |
commit | 75ebbd0b354739150e10da7216b44e2dde2c2b14 (patch) | |
tree | 7ab5b4c262b4b0a97434f5a569d969242a9af643 /src/qml/jsruntime/qv4jsonobject.cpp | |
parent | bffc040f8014b361992cd92671e559c1c2abd633 (diff) |
Quote stringified generic variants on JSON.stringify
A string representation of those is unlikely to be actual JSON, and even
if it is, we don't want to use it as such.
Fixes: QTBUG-72674
Change-Id: I6815366a0176d9725ff4840d3fc545792ce00535
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
Diffstat (limited to 'src/qml/jsruntime/qv4jsonobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4jsonobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4jsonobject.cpp b/src/qml/jsruntime/qv4jsonobject.cpp index 0c5436a0d6..936c032fad 100644 --- a/src/qml/jsruntime/qv4jsonobject.cpp +++ b/src/qml/jsruntime/qv4jsonobject.cpp @@ -739,7 +739,7 @@ QString Stringify::Str(const QString &key, const Value &v) } if (const QV4::VariantObject *v = value->as<QV4::VariantObject>()) { - return v->d()->data().toString(); + return quote(v->d()->data().toString()); } o = value->asReturnedValue(); |