diff options
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()) |