Changeset 2882 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Nov 26, 2002, 3:34:56 PM (23 years ago)
Author:
darin
Message:
  • kjs/property_map.cpp: (PropertyMap::save): Look at the attributes the same way in the single hash entry case as in the actual hash table case. Change the rule for which attributes to save to "attributes that don't have the ReadOnly, DontEnum, or Function bit set". Also fix bug where saving an empty property map would leave the count set to the old value.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r2881 r2882  
     12002-11-26  Darin Adler  <[email protected]>
     2
     3        * kjs/property_map.cpp:
     4        (PropertyMap::save): Look at the attributes the same way in the single hash entry
     5        case as in the actual hash table case. Change the rule for which attributes to save
     6        to "attributes that don't have the ReadOnly, DontEnum, or Function bit set".
     7        Also fix bug where saving an empty property map would leave the count set to the old value.
     8
    192002-11-26  Richard Williamson   <[email protected]>
    210
  • trunk/JavaScriptCore/ChangeLog-2002-12-03

    r2881 r2882  
     12002-11-26  Darin Adler  <[email protected]>
     2
     3        * kjs/property_map.cpp:
     4        (PropertyMap::save): Look at the attributes the same way in the single hash entry
     5        case as in the actual hash table case. Change the rule for which attributes to save
     6        to "attributes that don't have the ReadOnly, DontEnum, or Function bit set".
     7        Also fix bug where saving an empty property map would leave the count set to the old value.
     8
    192002-11-26  Richard Williamson   <[email protected]>
    210
  • trunk/JavaScriptCore/ChangeLog-2003-10-25

    r2881 r2882  
     12002-11-26  Darin Adler  <[email protected]>
     2
     3        * kjs/property_map.cpp:
     4        (PropertyMap::save): Look at the attributes the same way in the single hash entry
     5        case as in the actual hash table case. Change the rule for which attributes to save
     6        to "attributes that don't have the ReadOnly, DontEnum, or Function bit set".
     7        Also fix bug where saving an empty property map would leave the count set to the old value.
     8
    192002-11-26  Richard Williamson   <[email protected]>
    210
  • trunk/JavaScriptCore/kjs/property_map.cpp

    r2881 r2882  
    2525#include "reference_list.h"
    2626
     27#define DEBUG_PROPERTIES 0
    2728#define DO_CONSISTENCY_CHECK 0
    2829#define DUMP_STATISTICS 0
     
    6263    PropertyMapHashTableEntry entries[1];
    6364};
    64    
     65
    6566class SavedProperty {
    6667public:
     
    7475SavedProperties::~SavedProperties()
    7576{
    76     if (_properties){
    77         delete [] _properties;
    78     }
     77    delete [] _properties;
    7978}
    8079
     
    188187}
    189188
    190 #ifdef DEBUG_PROPERTIES
     189#if DEBUG_PROPERTIES
    191190static void printAttributes(int attributes)
    192191{
     
    212211    UString::Rep *rep = name._ustring.rep;
    213212   
    214 #ifdef DEBUG_PROPERTIES
     213#if DEBUG_PROPERTIES
    215214    printf ("adding property %s, attributes = 0x%08x (", name.ascii(), attributes);
    216215    printAttributes(attributes);
     
    440439    if (!_table) {
    441440#if USE_SINGLE_ENTRY
    442         if (_singleEntry.key)
     441        if (_singleEntry.key && !(_singleEntry.attributes & (ReadOnly | DontEnum | Function)))
    443442            ++count;
    444443#endif
    445444    } else {
    446445        for (int i = 0; i != _table->size; ++i)
    447             if (_table->entries[i].key && (_table->entries[i].attributes == 0 || _table->entries[i].attributes == (DontDelete | Internal)))
    448             //if (_table->entries[i].key)
     446            if (_table->entries[i].key && !(_table->entries[i].attributes & (ReadOnly | DontEnum | Function)))
    449447                ++count;
    450448    }
    451449
    452450    delete [] p._properties;
     451
     452    p._count = count;
     453
    453454    if (count == 0) {
    454455        p._properties = 0;
     
    457458   
    458459    p._properties = new SavedProperty [count];
    459     p._count = count;
    460460   
    461461    SavedProperty *prop = p._properties;
     
    463463    if (!_table) {
    464464#if USE_SINGLE_ENTRY
    465         if (_singleEntry.key) {
     465        if (_singleEntry.key && !(_singleEntry.attributes & (ReadOnly | DontEnum | Function))) {
    466466            prop->key = Identifier(_singleEntry.key);
    467467            prop->value = Value(_singleEntry.value);
     468            prop->attributes = _singleEntry.attributes;
    468469            ++prop;
    469470        }
     
    471472    } else {
    472473        for (int i = 0; i != _table->size; ++i) {
    473             if (_table->entries[i].key && (_table->entries[i].attributes == 0 || _table->entries[i].attributes == (DontDelete | Internal))) {
    474             //if (_table->entries[i].key) {
     474            if (_table->entries[i].key && !(_table->entries[i].attributes & (ReadOnly | DontEnum | Function))) {
    475475                prop->key = Identifier(_table->entries[i].key);
    476476                prop->value = Value(_table->entries[i].value);
     
    484484void PropertyMap::restore(const SavedProperties &p)
    485485{
    486     for (int i = 0; i != p._count; ++i){
     486    for (int i = 0; i != p._count; ++i)
    487487        put(p._properties[i].key, p._properties[i].value.imp(), p._properties[i].attributes);
    488     }
    489488}
    490489
Note: See TracChangeset for help on using the changeset viewer.