aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsapi/qjsvalueiterator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/jsapi/qjsvalueiterator.cpp')
-rw-r--r--src/qml/jsapi/qjsvalueiterator.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp
index aa1ecd6e54..2b074c3cb2 100644
--- a/src/qml/jsapi/qjsvalueiterator.cpp
+++ b/src/qml/jsapi/qjsvalueiterator.cpp
@@ -152,7 +152,7 @@ bool QJSValueIterator::next()
QString QJSValueIterator::name() const
{
if (!QJSValuePrivate::get(d_ptr->value)->value.isObject())
- return false;
+ return QString();
if (d_ptr->currentName)
return d_ptr->currentName->toQString();
if (d_ptr->currentIndex < UINT_MAX)
@@ -174,9 +174,11 @@ QJSValue QJSValueIterator::value() const
QV4::Object *o = d_ptr->iterator.object;
QV4::ExecutionEngine *engine = o->internalClass->engine;
+ QV4::Scope scope(engine);
+
QV4::ExecutionContext *ctx = engine->current;
try {
- QV4::Value v;
+ QV4::ScopedValue v(scope);
if (d_ptr->currentName)
v = o->get(d_ptr->currentName);
else if (d_ptr->currentIndex != UINT_MAX)