summaryrefslogtreecommitdiff
path: root/src/script/bridge
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-05 20:56:44 +0200
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-05 21:10:00 +0200
commit520378cfedd63544a9689687256d2c89352ee561 (patch)
tree79a2c0e667dc95ffed3b8300edff098d15664f41 /src/script/bridge
parenta0fecb437176786e9c809a45e64351516b05a201 (diff)
downloadqt4-tools-520378cfedd63544a9689687256d2c89352ee561.tar.gz
Updates getPropertyNames() on all javascript object to use the flag
getPropertyNames() now uses a flag to specify which property should be filtered. This flag should be used by all javascript objects. This patch fixes the changes introduced by e520df1f8678bd59adb341fb586f008a7de17fe8
Diffstat (limited to 'src/script/bridge')
-rw-r--r--src/script/bridge/qscriptclassobject.cpp4
-rw-r--r--src/script/bridge/qscriptclassobject_p.h2
-rw-r--r--src/script/bridge/qscriptobject.cpp10
-rw-r--r--src/script/bridge/qscriptobject_p.h4
-rw-r--r--src/script/bridge/qscriptqobject.cpp10
-rw-r--r--src/script/bridge/qscriptqobject_p.h4
6 files changed, 17 insertions, 17 deletions
diff --git a/src/script/bridge/qscriptclassobject.cpp b/src/script/bridge/qscriptclassobject.cpp
index 5232ca2915..f805f65009 100644
--- a/src/script/bridge/qscriptclassobject.cpp
+++ b/src/script/bridge/qscriptclassobject.cpp
@@ -177,7 +177,7 @@ bool ClassObjectDelegate::getPropertyAttributes(const QScriptObject* object, JSC
void ClassObjectDelegate::getPropertyNames(QScriptObject* object, JSC::ExecState *exec,
JSC::PropertyNameArray &propertyNames,
- bool includeNonEnumerable)
+ unsigned listedAttributes)
{
QScriptEnginePrivate *engine = scriptEngineFromExec(exec);
QScriptValue scriptObject = engine->scriptValueFromJSCValue(object);
@@ -190,7 +190,7 @@ void ClassObjectDelegate::getPropertyNames(QScriptObject* object, JSC::ExecState
}
delete it;
}
- QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames, includeNonEnumerable);
+ QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames, listedAttributes);
}
JSC::CallType ClassObjectDelegate::getCallData(QScriptObject*, JSC::CallData &callData)
diff --git a/src/script/bridge/qscriptclassobject_p.h b/src/script/bridge/qscriptclassobject_p.h
index 39d281dd10..10920471b3 100644
--- a/src/script/bridge/qscriptclassobject_p.h
+++ b/src/script/bridge/qscriptclassobject_p.h
@@ -90,7 +90,7 @@ public:
const JSC::Identifier&,
unsigned&) const;
virtual void getPropertyNames(QScriptObject*, JSC::ExecState*,
- JSC::PropertyNameArray&, bool includeNonEnumerable = false);
+ JSC::PropertyNameArray&, unsigned listedAttributes = JSC::Structure::Prototype);
virtual JSC::CallType getCallData(QScriptObject*, JSC::CallData&);
static JSC::JSValue JSC_HOST_CALL call(JSC::ExecState*, JSC::JSObject*,
diff --git a/src/script/bridge/qscriptobject.cpp b/src/script/bridge/qscriptobject.cpp
index e4d21685bf..bbc51d9c05 100644
--- a/src/script/bridge/qscriptobject.cpp
+++ b/src/script/bridge/qscriptobject.cpp
@@ -133,13 +133,13 @@ bool QScriptObject::getPropertyAttributes(JSC::ExecState* exec, const JSC::Ident
return d->delegate->getPropertyAttributes(this, exec, propertyName, attributes);
}
-void QScriptObject::getPropertyNames(JSC::ExecState* exec, JSC::PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void QScriptObject::getPropertyNames(JSC::ExecState* exec, JSC::PropertyNameArray& propertyNames, unsigned listedAttributes)
{
if (!d || !d->delegate) {
- JSC::JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ JSC::JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
return;
}
- d->delegate->getPropertyNames(this, exec, propertyNames, includeNonEnumerable);
+ d->delegate->getPropertyNames(this, exec, propertyNames, listedAttributes);
}
void QScriptObject::mark()
@@ -220,9 +220,9 @@ bool QScriptObjectDelegate::getPropertyAttributes(const QScriptObject* object,
void QScriptObjectDelegate::getPropertyNames(QScriptObject* object, JSC::ExecState* exec,
JSC::PropertyNameArray& propertyNames,
- bool includeNonEnumerable)
+ unsigned listedAttributes)
{
- object->JSC::JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ object->JSC::JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
void QScriptObjectDelegate::mark(QScriptObject* object)
diff --git a/src/script/bridge/qscriptobject_p.h b/src/script/bridge/qscriptobject_p.h
index b52e654680..8023e8e1d5 100644
--- a/src/script/bridge/qscriptobject_p.h
+++ b/src/script/bridge/qscriptobject_p.h
@@ -89,7 +89,7 @@ public:
bool checkDontDelete = true);
virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
unsigned&) const;
- virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, unsigned listedAttributes = JSC::Structure::Prototype);
virtual void mark();
virtual JSC::CallType getCallData(JSC::CallData&);
virtual JSC::ConstructType getConstructData(JSC::ConstructData&);
@@ -145,7 +145,7 @@ public:
virtual bool getPropertyAttributes(const QScriptObject*, JSC::ExecState*,
const JSC::Identifier&, unsigned&) const;
virtual void getPropertyNames(QScriptObject*, JSC::ExecState*, JSC::PropertyNameArray&,
- bool includeNonEnumerable = false);
+ unsigned listedAttributes = JSC::Structure::Prototype);
virtual void mark(QScriptObject*);
virtual JSC::CallType getCallData(QScriptObject*, JSC::CallData&);
virtual JSC::ConstructType getConstructData(QScriptObject*, JSC::ConstructData&);
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 3887fb7f82..892ca5b9c1 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1511,7 +1511,7 @@ bool QObjectDelegate::getPropertyAttributes(const QScriptObject *object,
void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *exec,
JSC::PropertyNameArray &propertyNames,
- bool includeNonEnumerable)
+ unsigned listedAttributes)
{
QObject *qobject = data->value;
if (!qobject) {
@@ -1527,7 +1527,7 @@ void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *ex
? meta->propertyOffset() : 0;
for ( ; i < meta->propertyCount(); ++i) {
QMetaProperty prop = meta->property(i);
- if (includeNonEnumerable || isEnumerableMetaProperty(prop, meta, i)) {
+ if ((listedAttributes & JSC::Structure::NonEnumerable) || isEnumerableMetaProperty(prop, meta, i)) {
QString name = QString::fromLatin1(prop.name());
propertyNames.add(JSC::Identifier(exec, qtStringToJSCUString(name)));
}
@@ -1555,7 +1555,7 @@ void QObjectDelegate::getPropertyNames(QScriptObject *object, JSC::ExecState *ex
}
}
- QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames, includeNonEnumerable);
+ QScriptObjectDelegate::getPropertyNames(object, exec, propertyNames, listedAttributes);
}
void QObjectDelegate::mark(QScriptObject *object)
@@ -1793,7 +1793,7 @@ bool QMetaObjectWrapperObject::getPropertyAttributes(JSC::ExecState *exec,
return JSC::JSObject::getPropertyAttributes(exec, propertyName, attributes);
}
-void QMetaObjectWrapperObject::getPropertyNames(JSC::ExecState *exec, JSC::PropertyNameArray &propertyNames, bool includeNonEnumerable)
+void QMetaObjectWrapperObject::getPropertyNames(JSC::ExecState *exec, JSC::PropertyNameArray &propertyNames, unsigned listedAttributes)
{
const QMetaObject *meta = data->value;
if (!meta)
@@ -1803,7 +1803,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, includeNonEnumerable);
+ JSC::JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
void QMetaObjectWrapperObject::mark()
diff --git a/src/script/bridge/qscriptqobject_p.h b/src/script/bridge/qscriptqobject_p.h
index 15c6e22d7d..cce585fdd0 100644
--- a/src/script/bridge/qscriptqobject_p.h
+++ b/src/script/bridge/qscriptqobject_p.h
@@ -108,7 +108,7 @@ public:
const JSC::Identifier&,
unsigned&) const;
virtual void getPropertyNames(QScriptObject*, JSC::ExecState*, JSC::PropertyNameArray&,
- bool includeNonEnumerable = false);
+ unsigned listedAttributes = JSC::Structure::Prototype);
virtual void mark(QScriptObject*);
inline QObject *value() const { return data->value; }
@@ -297,7 +297,7 @@ public:
virtual bool getPropertyAttributes(JSC::ExecState*, const JSC::Identifier&,
unsigned&) const;
virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&,
- bool includeNonEnumerable = false);
+ unsigned listedAttributes = JSC::Structure::Prototype);
virtual void mark();
virtual JSC::CallType getCallData(JSC::CallData&);