summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/API
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/3rdparty/webkit/JavaScriptCore/API
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/3rdparty/webkit/JavaScriptCore/API')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h3
3 files changed, 6 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h
index 9d22ad9..4f1d51c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h
@@ -66,7 +66,7 @@ private:
virtual bool hasInstance(ExecState* exec, JSValue value, JSValue proto);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
virtual double toNumber(ExecState*) const;
virtual UString toString(ExecState*) const;
diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h
index 987c59f..8bcf8ad 100644
--- a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h
+++ b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObjectFunctions.h
@@ -372,7 +372,7 @@ JSValue JSCallbackObject<Base>::call(ExecState* exec, JSObject* functionObject,
}
template <class Base>
-void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames)
+void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
{
JSContextRef execRef = toRef(exec);
JSObjectRef thisRef = toRef(this);
@@ -380,7 +380,7 @@ void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray
for (JSClassRef jsClass = classRef(); jsClass; jsClass = jsClass->parentClass) {
if (JSObjectGetPropertyNamesCallback getPropertyNames = jsClass->getPropertyNames) {
JSLock::DropAllLocks dropAllLocks(exec);
- getPropertyNames(execRef, thisRef, toRef(&propertyNames));
+ getPropertyNames(execRef, thisRef, toRef(&propertyNames), includeNonEnumerable);
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
@@ -406,7 +406,7 @@ void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray
}
}
- Base::getPropertyNames(exec, propertyNames);
+ Base::getPropertyNames(exec, propertyNames, includeNonEnumerable);
}
template <class Base>
diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h b/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
index 3e8b0eb..4dedc57 100644
--- a/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
+++ b/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
@@ -187,6 +187,7 @@ typedef bool
@param ctx The execution context to use.
@param object The JSObject whose property names are being collected.
@param accumulator A JavaScript property name accumulator in which to accumulate the names of object's properties.
+@param includeNonEnumerable Flag deciding if properties with the DontEnum attribute should be included.
@discussion If you named your function GetPropertyNames, you would declare it like this:
void GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
@@ -196,7 +197,7 @@ Property name accumulators are used by JSObjectCopyPropertyNames and JavaScript
Use JSPropertyNameAccumulatorAddName to add property names to accumulator. A class's getPropertyNames callback only needs to provide the names of properties that the class vends through a custom getProperty or setProperty callback. Other properties, including statically declared properties, properties vended by other classes, and properties belonging to object's prototype, are added independently.
*/
typedef void
-(*JSObjectGetPropertyNamesCallback) (JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
+(*JSObjectGetPropertyNamesCallback) (JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames, bool includeNonEnumerable);
/*!
@typedef JSObjectCallAsFunctionCallback