diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-11-12 09:50:29 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-15 13:07:52 +0100 |
commit | 0dc17ae4d8b01582d9a9d2fa89f0d72cd022f5cf (patch) | |
tree | c427b62e6f20f17b71f1f0de0d59cd5fc8b6d5ae /src | |
parent | d7a876d0025290e506622af85403fa3c5fed795b (diff) |
Fix === operator for value types
Fix === comparison for urls and other QML value types.
Task-number: QTBUG-33546
Change-Id: I4a7066e6bbc7de7c599fe2c7b2fdfb75e0ff5196
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/jsruntime/qv4runtime.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp index 376d61bd67..a8cabcb374 100644 --- a/src/qml/jsruntime/qv4runtime.cpp +++ b/src/qml/jsruntime/qv4runtime.cpp @@ -722,8 +722,8 @@ Bool __qmljs_strict_equal(const ValueRef x, const ValueRef y) if (x->isNumber()) return y->isNumber() && x->asDouble() == y->asDouble(); - if (x->isString()) - return y->isString() && x->stringValue()->isEqualTo(y->stringValue()); + if (x->isManaged()) + return y->isManaged() && x->managed()->isEqualTo(y->managed()); return false; } diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index eef901d74a..0e43d03987 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -234,7 +234,10 @@ bool String::isEqualTo(Managed *t, Managed *o) if (t == o) return true; - Q_ASSERT(t->type == Type_String && o->type == Type_String); + if (o->type != Type_String) + return false; + + Q_ASSERT(t->type == Type_String); String *that = static_cast<String *>(t); String *other = static_cast<String *>(o); if (that->hashValue() != other->hashValue()) |