Changeset 2871 in webkit for trunk/JavaScriptCore/kjs/property_map.cpp
- Timestamp:
- Nov 25, 2002, 6:49:38 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/property_map.cpp
r2863 r2871 186 186 } 187 187 188 #ifdef DEBUG_PROPERTIES 189 static void printAttributes(int attributes) 190 { 191 if (attributes == 0) 192 printf ("None "); 193 if (attributes & ReadOnly) 194 printf ("ReadOnly "); 195 if (attributes & DontEnum) 196 printf ("DontEnum "); 197 if (attributes & DontDelete) 198 printf ("DontDelete "); 199 if (attributes & Internal) 200 printf ("Internal "); 201 if (attributes & Function) 202 printf ("Function "); 203 } 204 #endif 205 188 206 void PropertyMap::put(const Identifier &name, ValueImp *value, int attributes) 189 207 { … … 191 209 192 210 UString::Rep *rep = name._ustring.rep; 211 212 #ifdef DEBUG_PROPERTIES 213 printf ("adding property %s, attributes = 0x%08x (", name.ascii(), attributes); 214 printAttributes(attributes); 215 printf (")\n"); 216 #endif 193 217 194 218 #if USE_SINGLE_ENTRY … … 419 443 } else { 420 444 for (int i = 0; i != _table->size; ++i) 421 if (_table->entries[i].key && _table->entries[i].attributes == 0) 445 if (_table->entries[i].key && (_table->entries[i].attributes == 0 || _table->entries[i].attributes == (DontDelete | Internal))) 446 //if (_table->entries[i].key) 422 447 ++count; 423 448 } … … 428 453 return; 429 454 } 455 430 456 p._properties = new SavedProperty [count]; 457 p._count = count; 431 458 432 459 SavedProperty *prop = p._properties; … … 442 469 } else { 443 470 for (int i = 0; i != _table->size; ++i) { 444 if (_table->entries[i].key && _table->entries[i].attributes == 0) { 471 if (_table->entries[i].key && (_table->entries[i].attributes == 0 || _table->entries[i].attributes == (DontDelete | Internal))) { 472 //if (_table->entries[i].key) { 445 473 prop->key = Identifier(_table->entries[i].key); 446 474 prop->value = Value(_table->entries[i].value); 475 ++prop; 447 476 } 448 477 } … … 452 481 void PropertyMap::restore(const SavedProperties &p) 453 482 { 454 for (int i = 0; i != p._count; ++i) 483 for (int i = 0; i != p._count; ++i){ 455 484 put(p._properties[i].key, p._properties[i].value.imp(), 0); 485 } 456 486 } 457 487
Note:
See TracChangeset
for help on using the changeset viewer.