Changeset 31225 in webkit for trunk/JavaScriptCore
- Timestamp:
- Mar 21, 2008, 7:36:34 PM (17 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r31216 r31225 1 2008-03-21 Oliver Hunt <[email protected]> 2 3 Reviewed by Geoff Garen. 4 5 Global properties that use LocalStorage are not correctly listed as enumerable. 6 7 The problem was caused by JSObject::getPropertyAttributes not being aware 8 of the JSVariableObject SymbolTable. The fix is to make getPropertyAttributes 9 virtual and override in JSVariableObject. This does not produce any performance 10 regression. 11 12 * JavaScriptCore.exp: 13 * kjs/JSVariableObject.cpp: 14 (KJS::JSVariableObject::getPropertyNames): 15 (KJS::JSVariableObject::getPropertyAttributes): 16 * kjs/JSVariableObject.h: 17 * kjs/object.h: 18 1 19 2008-03-21 Arkadiusz Miskiewicz <[email protected]> 2 20 -
trunk/JavaScriptCore/JavaScriptCore.exp
r31208 r31225 230 230 __ZNK3KJS16JSVariableObject16isVariableObjectEv 231 231 __ZNK3KJS16JSVariableObject16saveLocalStorageERNS_15SavedPropertiesE 232 __ZNK3KJS16JSVariableObject21getPropertyAttributesERKNS_10IdentifierERj 232 233 __ZNK3KJS19InternalFunctionImp14implementsCallEv 233 234 __ZNK3KJS19InternalFunctionImp21implementsHasInstanceEv … … 256 257 __ZNK3KJS8JSObject14implementsCallEv 257 258 __ZNK3KJS8JSObject19implementsConstructEv 259 __ZNK3KJS8JSObject21getPropertyAttributesERKNS_10IdentifierERj 258 260 __ZNK3KJS8JSObject21implementsHasInstanceEv 259 261 __ZNK3KJS8JSObject3getEPNS_9ExecStateERKNS_10IdentifierE -
trunk/JavaScriptCore/kjs/JSVariableObject.cpp
r31114 r31225 85 85 void JSVariableObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames) 86 86 { 87 SymbolTable::const_iterator::Keys end = symbolTable().end().keys(); 88 for (SymbolTable::const_iterator::Keys it = symbolTable().begin().keys(); it != end; ++it) 89 propertyNames.add(Identifier(it->get())); 87 SymbolTable::const_iterator end = symbolTable().end(); 88 for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) 89 if ((localStorage()[it->second].attributes & DontEnum) == 0) 90 propertyNames.add(Identifier(it->first.get())); 91 92 JSObject::getPropertyNames(exec, propertyNames); 93 } 90 94 91 JSObject::getPropertyNames(exec, propertyNames); 95 bool JSVariableObject::getPropertyAttributes(const Identifier& propertyName, unsigned& attributes) const 96 { 97 size_t index = symbolTable().get(propertyName.ustring().rep()); 98 if (index != missingSymbolMarker()) { 99 attributes = localStorage()[index].attributes; 100 return true; 101 } 102 return JSObject::getPropertyAttributes(propertyName, attributes); 92 103 } 93 104 -
trunk/JavaScriptCore/kjs/JSVariableObject.h
r31114 r31225 38 38 class JSVariableObject : public JSObject { 39 39 public: 40 SymbolTable& symbolTable() { return *d->symbolTable; }41 LocalStorage& localStorage() { return d->localStorage; }40 SymbolTable& symbolTable() const { return *d->symbolTable; } 41 LocalStorage& localStorage() const { return d->localStorage; } 42 42 43 43 void saveLocalStorage(SavedProperties&) const; … … 53 53 virtual bool isVariableObject() const; 54 54 virtual bool isDynamicScope() const = 0; 55 56 virtual bool getPropertyAttributes(const Identifier& propertyName, unsigned& attributes) const; 55 57 56 58 protected: -
trunk/JavaScriptCore/kjs/object.h
r31114 r31225 404 404 virtual JSObject *toObject(ExecState *exec) const; 405 405 406 bool getPropertyAttributes(const Identifier& propertyName, unsigned& attributes) const;406 virtual bool getPropertyAttributes(const Identifier& propertyName, unsigned& attributes) const; 407 407 408 408 // WebCore uses this to make document.all and style.filter undetectable
Note:
See TracChangeset
for help on using the changeset viewer.