Changeset 28884 in webkit for trunk/JavaScriptCore/kjs/JSVariableObject.cpp
- Timestamp:
- Dec 20, 2007, 1:32:06 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/JSVariableObject.cpp
r28777 r28884 31 31 32 32 #include "PropertyNameArray.h" 33 #include "property_map.h" 33 34 34 35 namespace KJS { 35 36 36 37 UString::Rep* IdentifierRepHashTraits::nullRepPtr = &UString::Rep::null; // Didn't want to make a whole source file for just this. 38 39 void JSVariableObject::saveSymbolTable(SymbolTable& s) const 40 { 41 s = *d->symbolTable; 42 } 43 44 void JSVariableObject::restoreSymbolTable(SymbolTable& s) const 45 { 46 *d->symbolTable = s; 47 } 48 49 void JSVariableObject::saveLocalStorage(SavedProperties& p) const 50 { 51 unsigned count = d->localStorage.size(); 52 53 p.m_properties.clear(); 54 p.m_count = count; 55 56 if (!count) 57 return; 58 59 p.m_properties.set(new SavedProperty[count]); 60 61 SavedProperty* prop = p.m_properties.get(); 62 for (size_t i = 0; i < count; ++i, ++prop) { 63 LocalStorageEntry& entry = d->localStorage[i]; 64 prop->value = entry.value; 65 prop->attributes = entry.attributes; 66 } 67 } 68 69 void JSVariableObject::restoreLocalStorage(SavedProperties& p) const 70 { 71 unsigned count = p.m_count; 72 d->localStorage.resize(count); 73 SavedProperty* prop = p.m_properties.get(); 74 for (size_t i = 0; i < count; ++i, ++prop) 75 d->localStorage[i] = LocalStorageEntry(prop->value, prop->attributes); 76 } 37 77 38 78 bool JSVariableObject::deleteProperty(ExecState* exec, const Identifier& propertyName)
Note:
See TracChangeset
for help on using the changeset viewer.