18void QJSValueIteratorPrivate::init(
const QJSValue &v)
22 QV4::ExecutionEngine *e = QJSValuePrivate::engine(&v);
25 const QV4::Object *o = QJSValuePrivate::asManagedType<QV4::Object>(&v);
30 object.set(e, o->asReturnedValue());
31 iterator.reset(o->ownPropertyKeys(object.valueRef()));
141QString QJSValueIterator::name()
const
143 if (!d_ptr->isValid())
145 QV4::Scope scope(d_ptr->engine);
146 QV4::ScopedPropertyKey key(scope, QV4::PropertyKey::fromId(d_ptr->currentKey.value()));
149 Q_ASSERT(!key->isSymbol());
150 return key->toStringOrSymbol(d_ptr->engine)->toQString();
160QJSValue QJSValueIterator::value()
const
162 if (!d_ptr->isValid())
164 QV4::Scope scope(d_ptr->engine);
165 QV4::ScopedPropertyKey key(scope, QV4::PropertyKey::fromId(d_ptr->currentKey.value()));
169 QV4::ScopedObject obj(scope, d_ptr->object.asManaged());
170 QV4::ScopedValue val(scope, obj->get(key));
172 if (scope.hasException()) {
173 scope.engine->catchException();
176 return QJSValuePrivate::fromReturnedValue(val->asReturnedValue());