diff options
author | Lars Knoll <lars.knoll@digia.com> | 2013-09-18 15:34:13 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-22 01:06:20 +0200 |
commit | 700ba1bcb39e082049c96fafdfaccfe5d83cd77e (patch) | |
tree | d21da27b94a927377ba2c6efd7c3af731d890b19 /src/qml/jsapi/qjsvalueiterator.cpp | |
parent | 1aa618970a9bed46123d0648500e957688d725ec (diff) |
Use a StringRef for Managed::get()
also store "toString" and "valueOf" as identifiers
in the engine and fix two places where we compared
strings the wrong way.
Change-Id: I70612221e72d43ed0e3c496e4209681bf254cded
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsapi/qjsvalueiterator.cpp')
-rw-r--r-- | src/qml/jsapi/qjsvalueiterator.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp index 2b074c3cb2..b4156dcd1d 100644 --- a/src/qml/jsapi/qjsvalueiterator.cpp +++ b/src/qml/jsapi/qjsvalueiterator.cpp @@ -179,12 +179,14 @@ QJSValue QJSValueIterator::value() const QV4::ExecutionContext *ctx = engine->current; try { QV4::ScopedValue v(scope); - if (d_ptr->currentName) - v = o->get(d_ptr->currentName); - else if (d_ptr->currentIndex != UINT_MAX) + if (d_ptr->currentName) { + QV4::ScopedString n(scope, d_ptr->currentName); + v = o->get(n); + } else if (d_ptr->currentIndex != UINT_MAX) { v = o->getIndexed(d_ptr->currentIndex); - else + } else { return QJSValue(); + } return new QJSValuePrivate(engine, v); } catch (QV4::Exception &e) { e.accept(ctx); |