diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-11 21:48:23 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-18 13:13:36 +0200 |
commit | 6c9f1c8ed93374c16ca6ac540f39e98b451be0d8 (patch) | |
tree | 476d0046c6016a8cd62bfc29ed9697d98e98f738 /src/qml/jsruntime/qv4string.cpp | |
parent | bdb27b96acbd38531879378c48959a5a1cd60963 (diff) |
Use a ReturnedValue for Managed::getIndexed()
Change-Id: I0371ed21c4ef99564d3ffa1082dd109e890a78bf
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4string.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4string.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4string.cpp b/src/qml/jsruntime/qv4string.cpp index 7342b27fb8..2b2eda7c8c 100644 --- a/src/qml/jsruntime/qv4string.cpp +++ b/src/qml/jsruntime/qv4string.cpp @@ -150,25 +150,25 @@ ReturnedValue String::get(Managed *m, String *name, bool *hasProperty) return v4->stringClass->prototype->getValue(Value::fromString(that), pd, attrs); } -Value String::getIndexed(Managed *m, uint index, bool *hasProperty) +ReturnedValue String::getIndexed(Managed *m, uint index, bool *hasProperty) { String *that = static_cast<String *>(m); ExecutionEngine *engine = that->engine(); if (index < that->_text.length()) { if (hasProperty) *hasProperty = true; - return Value::fromString(engine->newString(that->toQString().mid(index, 1))); + return Value::fromString(engine->newString(that->toQString().mid(index, 1))).asReturnedValue(); } PropertyAttributes attrs; Property *pd = engine->stringClass->prototype->__getPropertyDescriptor__(index, &attrs); if (!pd || attrs.isGeneric()) { if (hasProperty) *hasProperty = false; - return Value::undefinedValue(); + return Value::undefinedValue().asReturnedValue(); } if (hasProperty) *hasProperty = true; - return Value::fromReturnedValue(engine->stringClass->prototype->getValue(Value::fromString(that), pd, attrs)); + return engine->stringClass->prototype->getValue(Value::fromString(that), pd, attrs); } void String::put(Managed *m, String *name, const Value &value) |