19void QJSValueIteratorPrivate::init(
const QJSValue &v)
23 QV4::ExecutionEngine *e = QJSValuePrivate::engine(&v);
26 const QV4::Object *o = QJSValuePrivate::asManagedType<QV4::Object>(&v);
31 object.set(e, o->asReturnedValue());
32 iterator.reset(o->ownPropertyKeys(object.valueRef()));
142QString QJSValueIterator::name()
const
144 if (!d_ptr->isValid())
146 QV4::Scope scope(d_ptr->engine);
147 QV4::ScopedPropertyKey key(scope, QV4::PropertyKey::fromId(d_ptr->currentKey.value()));
150 Q_ASSERT(!key->isSymbol());
151 return key->toStringOrSymbol(d_ptr->engine)->toQString();
161QJSValue QJSValueIterator::value()
const
163 if (!d_ptr->isValid())
165 QV4::Scope scope(d_ptr->engine);
166 QV4::ScopedPropertyKey key(scope, QV4::PropertyKey::fromId(d_ptr->currentKey.value()));
170 QV4::ScopedObject obj(scope, d_ptr->object.asManaged());
171 QV4::ScopedValue val(scope, obj->get(key));
173 if (scope.hasException()) {
174 scope.engine->catchException();
177 return QJSValuePrivate::fromReturnedValue(val->asReturnedValue());