diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-05-07 13:33:24 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-07-22 13:49:12 +0200 |
commit | 33593f00e84e6fb05191e9bb88000566c0c96426 (patch) | |
tree | 127877f1719689659a8ec6cea669ad5d38ec0903 /src/qml/jsapi | |
parent | 9afc7d9a53ad86e548e2d239ff012bed15eb52ba (diff) |
Get rid of StringRef
Remove the Ref classes, as they won't be required
anymore once Managed and Managed::Data are separated.
Change-Id: Ic6bec2d5b4ecf2595ce129dbb45bbf6a385138a5
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi')
-rw-r--r-- | src/qml/jsapi/qjsvalue.cpp | 14 | ||||
-rw-r--r-- | src/qml/jsapi/qjsvalueiterator.cpp | 12 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/qml/jsapi/qjsvalue.cpp b/src/qml/jsapi/qjsvalue.cpp index 04e2d2802c..ec45ce9374 100644 --- a/src/qml/jsapi/qjsvalue.cpp +++ b/src/qml/jsapi/qjsvalue.cpp @@ -861,7 +861,7 @@ QJSValue QJSValue::property(const QString& name) const s->makeIdentifier(); QV4::ExecutionContext *ctx = engine->currentContext(); QV4::ScopedValue result(scope); - result = o->get(s); + result = o->get(s.getPointer()); if (scope.hasException()) result = ctx->catchException(); @@ -893,7 +893,7 @@ QJSValue QJSValue::property(quint32 arrayIndex) const QV4::ExecutionContext *ctx = engine->currentContext(); QV4::ScopedValue result(scope); - result = arrayIndex == UINT_MAX ? o->get(engine->id_uintMax) : o->getIndexed(arrayIndex); + result = arrayIndex == UINT_MAX ? o->get(engine->id_uintMax.getPointer()) : o->getIndexed(arrayIndex); if (scope.hasException()) result = ctx->catchException(); return new QJSValuePrivate(engine, result); @@ -936,7 +936,7 @@ void QJSValue::setProperty(const QString& name, const QJSValue& value) QV4::ExecutionContext *ctx = engine->currentContext(); s->makeIdentifier(); QV4::ScopedValue v(scope, value.d->getValue(engine)); - o->put(s, v); + o->put(s.getPointer(), v); if (scope.hasException()) ctx->catchException(); } @@ -969,7 +969,7 @@ void QJSValue::setProperty(quint32 arrayIndex, const QJSValue& value) if (arrayIndex != UINT_MAX) o->putIndexed(arrayIndex, v); else - o->put(engine->id_uintMax, v); + o->put(engine->id_uintMax.getPointer(), v); if (scope.hasException()) ctx->catchException(); } @@ -1004,7 +1004,7 @@ bool QJSValue::deleteProperty(const QString &name) return false; ScopedString s(scope, engine->newString(name)); - bool b = o->deleteProperty(s); + bool b = o->deleteProperty(s.getPointer()); if (scope.hasException()) ctx->catchException(); return b; @@ -1028,7 +1028,7 @@ bool QJSValue::hasProperty(const QString &name) const return false; ScopedString s(scope, engine->newIdentifier(name)); - return o->hasProperty(s); + return o->hasProperty(s.getPointer()); } /*! @@ -1049,7 +1049,7 @@ bool QJSValue::hasOwnProperty(const QString &name) const return false; ScopedString s(scope, engine->newIdentifier(name)); - return o->hasOwnProperty(s); + return o->hasOwnProperty(s.getPointer()); } /*! diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index 7e2ea5d104..449fb8235a 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -109,7 +109,9 @@ QJSValueIterator::QJSValueIterator(const QJSValue& object) QV4::Scope scope(v4); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); it->d()->it.flags = QV4::ObjectIterator::NoFlags; - it->d()->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; } /*! @@ -155,7 +157,9 @@ bool QJSValueIterator::next() return false; QV4::Scope scope(v4); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); - it->d()->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; return !!d_ptr->currentName || d_ptr->currentIndex != UINT_MAX; } @@ -230,7 +234,9 @@ QJSValueIterator& QJSValueIterator::operator=(QJSValue& object) d_ptr->iterator = v4->newForEachIteratorObject(v4->currentContext(), o)->asReturnedValue(); QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value()); it->d()->it.flags = QV4::ObjectIterator::NoFlags; - it->d()->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + QV4::String *nm = 0; + it->d()->it.next(nm, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes); + d_ptr->nextName = nm; return *this; } |