diff options
-rw-r--r-- | src/qml/jsruntime/qv4value.cpp | 4 | ||||
-rw-r--r-- | src/qml/jsruntime/qv4value_p.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4value.cpp b/src/qml/jsruntime/qv4value.cpp index e7aaa97e6b..0d4711df3c 100644 --- a/src/qml/jsruntime/qv4value.cpp +++ b/src/qml/jsruntime/qv4value.cpp @@ -238,15 +238,11 @@ bool Value::sameValue(Value other) const { #ifndef V4_BOOTSTRAP Heap::String *Value::toString(ExecutionEngine *e, Value val) { - if (String *s = val.stringValue()) - return s->d(); return RuntimeHelpers::convertToString(e, val); } Heap::Object *Value::toObject(ExecutionEngine *e, Value val) { - if (Object *o = val.objectValue()) - return o->d(); return RuntimeHelpers::convertToObject(e, val); } diff --git a/src/qml/jsruntime/qv4value_p.h b/src/qml/jsruntime/qv4value_p.h index 0608252082..14ef62da36 100644 --- a/src/qml/jsruntime/qv4value_p.h +++ b/src/qml/jsruntime/qv4value_p.h @@ -428,10 +428,14 @@ public: QString toQStringNoThrow() const; QString toQString() const; Heap::String *toString(ExecutionEngine *e) const { + if (isString()) + return reinterpret_cast<Heap::String *>(m()); return toString(e, *this); } static Heap::String *toString(ExecutionEngine *e, Value val); Heap::Object *toObject(ExecutionEngine *e) const { + if (isObject()) + return reinterpret_cast<Heap::Object *>(m()); return toObject(e, *this); } static Heap::Object *toObject(ExecutionEngine *e, Value val); |