diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-16 13:35:32 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-02 14:19:45 +0000 |
commit | f3d6ed472fd2386c77cc286c067abee0a20fc0b9 (patch) | |
tree | 3a373a2b4ed2ee2b1aac454139f77506efedc137 /src/qml/jsruntime/qv4value.cpp | |
parent | 613dede03b1fa742027072c5656ef6ccefc651ad (diff) |
Fixes to symbol handling in StringObject and toString()
Change-Id: I0990e9610a3200502719191fa0a4174ba9ee1903
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4value.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4value.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index bd397752fe..a18dffac1e 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -205,9 +205,12 @@ QString Value::toQString() const else return QStringLiteral("false"); case Value::Managed_Type: - if (String *s = stringValue()) + if (String *s = stringValue()) { return s->toQString(); - { + } else if (isSymbol()) { + static_cast<const Managed *>(this)->engine()->throwTypeError(); + return QString(); + } else { Q_ASSERT(isObject()); Scope scope(objectValue()->engine()); ScopedValue prim(scope, RuntimeHelpers::toPrimitive(*this, STRING_HINT)); |