diff options
author | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-10-22 17:50:52 (GMT) |
---|---|---|
committer | Jocelyn Turcotte <jocelyn.turcotte@nokia.com> | 2009-10-22 18:34:20 (GMT) |
commit | 57f1983c164bc8553c6b6aa7ac320f00e5405548 (patch) | |
tree | 6cfbec33f6e385ceb5cbfa0168f4a9f27f0c8e57 /src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp | |
parent | 5baebfc68dd67def412bcbaa7c61b43d05e6ee42 (diff) | |
download | Qt-57f1983c164bc8553c6b6aa7ac320f00e5405548.zip Qt-57f1983c164bc8553c6b6aa7ac320f00e5405548.tar.gz Qt-57f1983c164bc8553c6b6aa7ac320f00e5405548.tar.bz2 |
Updated WebKit from /home/jturcott/dev/webkit/ to qtwebkit-4.6-snapshot-22102009 ( 0639bb8e812c8923287cd5523248ca64fa5f7a50 )
Changes in WebKit/qt since the last update:
Jocelyn: fatal error from script, sha1 in src/3rdparty/webkit/VERSION is bad
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp index db2a9b2..6932ded 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/JSObject.cpp @@ -42,6 +42,25 @@ namespace JSC { ASSERT_CLASS_FITS_IN_CELL(JSObject); +static inline void getEnumerablePropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames) +{ + // Add properties from the static hashtables of properties + for (; classInfo; classInfo = classInfo->parentClass) { + const HashTable* table = classInfo->propHashTable(exec); + if (!table) + continue; + table->initializeIfNeeded(exec); + ASSERT(table->table); + + int hashSizeMask = table->compactSize - 1; + const HashEntry* entry = table->table; + for (int i = 0; i <= hashSizeMask; ++i, ++entry) { + if (entry->key() && !(entry->attributes() & DontEnum)) + propertyNames.add(entry->key()); + } + } +} + void JSObject::markChildren(MarkStack& markStack) { #ifndef NDEBUG @@ -424,12 +443,29 @@ bool JSObject::getPropertySpecificValue(ExecState*, const Identifier& propertyNa void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) { - m_structure->getEnumerablePropertyNames(exec, propertyNames, this); + getOwnPropertyNames(exec, propertyNames); + + if (prototype().isNull()) + return; + + JSObject* prototype = asObject(this->prototype()); + while(1) { + if (prototype->structure()->typeInfo().overridesGetPropertyNames()) { + prototype->getPropertyNames(exec, propertyNames); + break; + } + prototype->getOwnPropertyNames(exec, propertyNames); + JSValue nextProto = prototype->prototype(); + if (nextProto.isNull()) + break; + prototype = asObject(nextProto); + } } void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) { - m_structure->getOwnEnumerablePropertyNames(exec, propertyNames, this); + m_structure->getEnumerablePropertyNames(propertyNames); + getEnumerablePropertyNames(exec, classInfo(), propertyNames); } bool JSObject::toBoolean(ExecState*) const |