summaryrefslogtreecommitdiffstats
path: root/src/script/bridge/qscriptqobject.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-07-30 21:31:01 (GMT)
committerTor Arne Vestbø <tor.arne.vestbo@nokia.com>2009-07-31 11:46:44 (GMT)
commit819bc9a2f9f86260af8a76027a712b2a310a088d (patch)
tree48a11b945fde67434da02d8629e1de794f81a7b1 /src/script/bridge/qscriptqobject.cpp
parentb2fc6a9406f3b59f9e800e9d2d567d0dabde6cef (diff)
downloadQt-819bc9a2f9f86260af8a76027a712b2a310a088d.zip
Qt-819bc9a2f9f86260af8a76027a712b2a310a088d.tar.gz
Qt-819bc9a2f9f86260af8a76027a712b2a310a088d.tar.bz2
QScriptValueIterator: fix missing non-enumerable values
Added an extra argument to JSObject::getPropertyNames() that specifies if the non-enumerable properties (those with the DontEnum attribute set) should be included or not. Tried looking at using a unsigned as an attribute-inclusion or exclusion filter, but the semantics of either the calling or the callee code would be very strange so I opted out.
Diffstat (limited to 'src/script/bridge/qscriptqobject.cpp')
-rw-r--r--src/script/bridge/qscriptqobject.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index ad43e55..9c15233 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1490,7 +1490,8 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
}
void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *exec,
- JSC::PropertyNameArray &propertyNames)
+ JSC::PropertyNameArray &propertyNames,
+ bool includeNonEnumerable)
{
QObject *qobject = data->value;
if (!qobject) {
@@ -1506,7 +1507,7 @@ void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *ex
? meta->propertyOffset() : 0;
for ( ; i < meta->propertyCount(); ++i) {
QMetaProperty prop = meta->property(i);
- if (isEnumerableMetaProperty(prop, meta, i)) {
+ if (includeNonEnumerable || isEnumerableMetaProperty(prop, meta, i)) {
QString name = QString::fromLatin1(prop.name());
propertyNames.add(JSC::Identifier(exec, qtStringToJSCUString(name)));
}
@@ -1534,7 +1535,7 @@ void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *ex
}
}
- QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames);
+ QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames, includeNonEnumerable);
}
void QObjectDelegate::mark(QScriptObject *object)
@@ -1768,7 +1769,7 @@ bool QMetaObjectWrapperObject::getPropertyAttributes(JSC::ExecState *exec,
return JSC::JSObject::getPropertyAttributes(exec, propertyName, attributes);
}
-void QMetaObjectWrapperObject::getPropertyNames(JSC::ExecState *exec, JSC::PropertyNameArray &propertyNames)
+void QMetaObjectWrapperObject::getPropertyNames(JSC::ExecState *exec, JSC::PropertyNameArray &propertyNames, bool includeNonEnumerable)
{
const QMetaObject *meta = data->value;
if (!meta)
@@ -1778,7 +1779,7 @@ void QMetaObjectWrapperObject::getPropertyNames(JSC::ExecState *exec, JSC::Prope
for (int j = 0; j < e.keyCount(); ++j)
propertyNames.add(JSC::Identifier(exec, e.key(j)));
}
- JSC::JSObject::getPropertyNames(exec, propertyNames);
+ JSC::JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
}
void QMetaObjectWrapperObject::mark()