void QScriptValueIteratorImpl::setValue(const QScriptValueImpl &value) { if (!m_member.isValid()) return; if (m_member.isGetterOrSetter()) { // find and call the setter QScriptValueImpl setter; if (m_member.isObjectProperty() && !m_member.isSetter()) { QScript::Member mb; QScriptObject *obj = m_object.m_object_value; mb.object(m_member.nameId(), obj->memberCount(), 0); if (!obj->findSetter(&mb)) return; m_object.get(mb, &setter); } else { m_object.get(m_member, &setter); } setter.call(m_object, QScriptValueImplList() << value); } else { m_object.put(m_member, value); } }
QScriptValueImpl QScriptValueIteratorImpl::value() const { if (!m_member.isValid()) return QScriptValueImpl(); QScriptValueImpl result; m_object.get(m_member, &result); if (m_member.isGetterOrSetter()) { // find and call the getter QScriptValueImpl getter; if (m_member.isObjectProperty() && !m_member.isGetter()) { QScript::Member mb; QScriptObject *obj = m_object.m_object_value; mb.object(m_member.nameId(), obj->memberCount(), 0); if (!obj->findGetter(&mb)) return QScriptValueImpl(); m_object.get(mb, &getter); } else { getter = result; } result = getter.call(m_object); } return result; }