summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-05 18:56:44 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2009-08-05 19:10:00 (GMT)
commit520378cfedd63544a9689687256d2c89352ee561 (patch)
tree79a2c0e667dc95ffed3b8300edff098d15664f41 /src/3rdparty/webkit/JavaScriptCore
parenta0fecb437176786e9c809a45e64351516b05a201 (diff)
downloadQt-520378cfedd63544a9689687256d2c89352ee561.zip
Qt-520378cfedd63544a9689687256d2c89352ee561.tar.gz
Qt-520378cfedd63544a9689687256d2c89352ee561.tar.bz2
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/3rdparty/webkit/JavaScriptCore')
-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.h4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.cpp2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h1
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.cpp6
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.h2
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/RegExpMatchesArray.h4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.cpp4
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.h2
17 files changed, 26 insertions, 27 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h b/src/3rdparty/webkit/JavaScriptCore/API/JSCallbackObject.h
index 853ce6d..4360baa 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&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
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 cc59a71..669b3cd 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, bool includeNonEnumerable)
+void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
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), includeNonEnumerable);
+ getPropertyNames(execRef, thisRef, toRef(&propertyNames), listedAttributes);
}
if (OpaqueJSClassStaticValuesTable* staticValues = jsClass->staticValues(exec)) {
@@ -406,7 +406,7 @@ void JSCallbackObject<Base>::getPropertyNames(ExecState* exec, PropertyNameArray
}
}
- Base::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ Base::getPropertyNames(exec, propertyNames, listedAttributes);
}
template <class Base>
diff --git a/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h b/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
index 4dedc57..86921bd 100644
--- a/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
+++ b/src/3rdparty/webkit/JavaScriptCore/API/JSObjectRef.h
@@ -187,7 +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.
+@param flag Specify which property should be included
@discussion If you named your function GetPropertyNames, you would declare it like this:
void GetPropertyNames(JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames);
@@ -197,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, bool includeNonEnumerable);
+(*JSObjectGetPropertyNamesCallback) (JSContextRef ctx, JSObjectRef object, JSPropertyNameAccumulatorRef propertyNames, unsigned flag);
/*!
@typedef JSObjectCallAsFunctionCallback
diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.cpp b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.cpp
index f51b650..c1815c8 100644
--- a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.cpp
@@ -70,9 +70,9 @@ bool DebuggerActivation::deleteProperty(ExecState* exec, const Identifier& prope
return m_activation->deleteProperty(exec, propertyName, checkDontDelete);
}
-void DebuggerActivation::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void DebuggerActivation::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
- m_activation->getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ m_activation->getPropertyNames(exec, propertyNames, listedAttributes);
}
bool DebuggerActivation::getPropertyAttributes(JSC::ExecState* exec, const Identifier& propertyName, unsigned& attributes) const
diff --git a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.h b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.h
index 4e5b60f..7c9f7d1 100644
--- a/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.h
+++ b/src/3rdparty/webkit/JavaScriptCore/debugger/DebuggerActivation.h
@@ -42,7 +42,7 @@ namespace JSC {
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName, bool checkDontDelete = true);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const;
virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction);
virtual void defineSetter(ExecState*, const Identifier& propertyName, JSObject* setterFunction);
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp
index 3c83623..a8207e3 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.cpp
@@ -427,7 +427,7 @@ bool JSArray::deleteProperty(ExecState* exec, unsigned i, bool checkDontDelete)
return false;
}
-void JSArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void JSArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
// FIXME: Filling PropertyNameArray with an identifier for every integer
// is incredibly inefficient for large arrays. We need a different approach,
@@ -447,7 +447,7 @@ void JSArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames
propertyNames.add(Identifier::from(exec, it->first));
}
- JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
bool JSArray::increaseVectorLength(unsigned newLength)
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h
index 266edfc..73e1711 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSArray.h
@@ -87,7 +87,7 @@ namespace JSC {
virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName, bool checkDontDelete = true);
virtual bool deleteProperty(ExecState*, unsigned propertyName, bool checkDontDelete = true);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual void mark();
void* lazyCreationData();
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.cpp
index fad7451..d00b69c 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.cpp
@@ -85,12 +85,12 @@ void JSByteArray::put(ExecState* exec, unsigned propertyName, JSValue value)
setIndex(exec, propertyName, value);
}
-void JSByteArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void JSByteArray::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
unsigned length = m_storage->length();
for (unsigned i = 0; i < length; ++i)
propertyNames.add(Identifier::from(exec, i));
- JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
index ff57488..c43c3ea 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSByteArray.h
@@ -81,7 +81,7 @@ namespace JSC {
virtual void put(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, JSC::PutPropertySlot&);
virtual void put(JSC::ExecState*, unsigned propertyName, JSC::JSValue);
- virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual const ClassInfo* classInfo() const { return m_classInfo; }
static const ClassInfo s_defaultInfo;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.cpp
index e4aa23c..fb9cfe8 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.cpp
@@ -116,7 +116,7 @@ bool JSNotAnObject::deleteProperty(ExecState* exec, unsigned)
return false;
}
-void JSNotAnObject::getPropertyNames(ExecState* exec, PropertyNameArray&, bool)
+void JSNotAnObject::getPropertyNames(ExecState* exec, PropertyNameArray&, unsigned)
{
ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception);
}
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.h
index dc89c66..0aca63b 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSNotAnObject.h
@@ -87,7 +87,7 @@ namespace JSC {
virtual bool deleteProperty(ExecState*, const Identifier& propertyName);
virtual bool deleteProperty(ExecState*, unsigned propertyName);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
JSNotAnObjectErrorStub* m_exception;
};
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h
index 09f038f..15b7957 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.h
@@ -116,7 +116,6 @@ namespace JSC {
virtual JSValue defaultValue(ExecState*, PreferredPrimitiveType) const;
virtual bool hasInstance(ExecState*, JSValue, JSValue prototypeProperty);
-
virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.cpp
index f873672..78993b6 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.cpp
@@ -41,15 +41,15 @@ bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propert
return JSObject::deleteProperty(exec, propertyName, checkDontDelete);
}
-void JSVariableObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void JSVariableObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
SymbolTable::const_iterator end = symbolTable().end();
for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) {
- if (includeNonEnumerable || !(it->second.getAttributes() & DontEnum))
+ if ((listedAttributes & Structure::NonEnumerable) || !(it->second.getAttributes() & DontEnum))
propertyNames.add(Identifier(exec, it->first.get()));
}
- JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
bool JSVariableObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.h
index 35899aa..310efb1 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSVariableObject.h
@@ -49,7 +49,7 @@ namespace JSC {
virtual void putWithAttributes(ExecState*, const Identifier&, JSValue, unsigned attributes) = 0;
virtual bool deleteProperty(ExecState*, const Identifier&, bool checkDontDelete = true);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual bool isVariableObject() const;
virtual bool isDynamicScope() const = 0;
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpMatchesArray.h b/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpMatchesArray.h
index c891faa..cbba85a 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpMatchesArray.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/RegExpMatchesArray.h
@@ -72,11 +72,11 @@ namespace JSC {
return JSArray::deleteProperty(exec, propertyName, checkDontDelete);
}
- virtual void getPropertyNames(ExecState* exec, PropertyNameArray& arr, bool includeNonEnumerable = false)
+ virtual void getPropertyNames(ExecState* exec, PropertyNameArray& arr, unsigned listedAttributes)
{
if (lazyCreationData())
fillArrayInstance(exec);
- JSArray::getPropertyNames(exec, arr, includeNonEnumerable);
+ JSArray::getPropertyNames(exec, arr, listedAttributes);
}
void fillArrayInstance(ExecState*);
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.cpp
index 36970b1..4745a98 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.cpp
@@ -79,12 +79,12 @@ bool StringObject::deleteProperty(ExecState* exec, const Identifier& propertyNam
return JSObject::deleteProperty(exec, propertyName, checkDontDelete);
}
-void StringObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, bool includeNonEnumerable)
+void StringObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, unsigned listedAttributes)
{
int size = internalValue()->value().size();
for (int i = 0; i < size; ++i)
propertyNames.add(Identifier(exec, UString::from(i)));
- return JSObject::getPropertyNames(exec, propertyNames, includeNonEnumerable);
+ return JSObject::getPropertyNames(exec, propertyNames, listedAttributes);
}
bool StringObject::getPropertyAttributes(ExecState* exec, const Identifier& propertyName, unsigned& attributes) const
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.h b/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.h
index c1cde15..fdeb2c1 100644
--- a/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.h
+++ b/src/3rdparty/webkit/JavaScriptCore/runtime/StringObject.h
@@ -38,7 +38,7 @@ namespace JSC {
virtual void put(ExecState* exec, const Identifier& propertyName, JSValue, PutPropertySlot&);
virtual bool deleteProperty(ExecState*, const Identifier& propertyName, bool checkDontDelete = true);
- virtual void getPropertyNames(ExecState*, PropertyNameArray&, bool includeNonEnumerable = false);
+ virtual void getPropertyNames(ExecState*, PropertyNameArray&, unsigned listedAttributes = Structure::Prototype);
virtual bool getPropertyAttributes(ExecState*, const Identifier& propertyName, unsigned& attributes) const;
virtual const ClassInfo* classInfo() const { return &info; }