Changeset 31147 in webkit for trunk/JavaScriptCore/kjs/object.cpp
- Timestamp:
- Mar 18, 2008, 9:23:21 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object.cpp
r31145 r31147 315 315 // Look in the static hashtable of properties 316 316 const HashEntry* entry = findPropertyHashEntry(propertyName); 317 if (entry && entry->attr & DontDelete)317 if (entry && entry->attributes & DontDelete) 318 318 return false; // this builtin property can't be deleted 319 // FIXME: Should the code here actually do some deletion? 319 320 return true; 320 321 } … … 378 379 const HashEntry* JSObject::findPropertyHashEntry(const Identifier& propertyName) const 379 380 { 380 for (const ClassInfo *info = classInfo(); info; info = info->parentClass) {381 if (const HashTable *propHashTable = info->propHashTable) {382 if (const HashEntry *e = Lookup::findEntry(propHashTable,propertyName))383 return e;384 }385 }386 return 0;381 for (const ClassInfo* info = classInfo(); info; info = info->parentClass) { 382 if (const HashTable* propHashTable = info->propHashTable) { 383 if (const HashEntry* e = propHashTable->entry(propertyName)) 384 return e; 385 } 386 } 387 return 0; 387 388 } 388 389 … … 488 489 const HashEntry* e = findPropertyHashEntry(propertyName); 489 490 if (e) { 490 attributes = e->attr ;491 attributes = e->attributes; 491 492 return true; 492 493 } … … 497 498 void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) 498 499 { 499 _prop.getEnumerablePropertyNames(propertyNames); 500 501 // Add properties from the static hashtable of properties 502 const ClassInfo *info = classInfo(); 503 while (info) { 504 if (info->propHashTable) { 505 int size = info->propHashTable->size; 506 const HashEntry *e = info->propHashTable->entries; 507 for (int i = 0; i < size; ++i, ++e) { 508 if (e->s && !(e->attr & DontEnum)) 509 propertyNames.add(e->s); 510 } 511 } 512 info = info->parentClass; 513 } 514 if (_proto->isObject()) 515 static_cast<JSObject*>(_proto)->getPropertyNames(exec, propertyNames); 500 _prop.getEnumerablePropertyNames(propertyNames); 501 502 // Add properties from the static hashtables of properties 503 for (const ClassInfo* info = classInfo(); info; info = info->parentClass) { 504 const HashTable* table = info->propHashTable; 505 if (!table) 506 continue; 507 if (!table->table) 508 table->createTable(); 509 ASSERT(table->table); 510 int hashSizeMask = table->hashSizeMask; 511 const HashEntry* e = table->table; 512 for (int i = 0; i <= hashSizeMask; ++i, ++e) { 513 if (e->key && !(e->attributes & DontEnum)) 514 propertyNames.add(Identifier(e->key)); 515 } 516 } 517 518 if (_proto->isObject()) 519 static_cast<JSObject*>(_proto)->getPropertyNames(exec, propertyNames); 516 520 } 517 521
Note:
See TracChangeset
for help on using the changeset viewer.