Changeset 440 for trunk/JavaScriptCore/kjs/JSString.h
- Timestamp:
- 08/18/08 11:14:49 (5 months ago)
- Files:
-
- trunk/JavaScriptCore/kjs/JSString.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/JavaScriptCore/kjs/JSString.h
r402 r440 28 28 #include "ExecState.h" 29 29 #include "JSCell.h" 30 #include "JSNumberCell.h" 30 31 #include "PropertySlot.h" 31 32 #include "identifier.h" … … 51 52 52 53 bool getStringPropertySlot(ExecState*, const Identifier& propertyName, PropertySlot&); 53 bool getStringPropertySlot( unsigned propertyName, PropertySlot&);54 bool getStringPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 54 55 55 56 bool canGetIndex(unsigned i) { return i < static_cast<unsigned>(m_value.size()); } … … 78 79 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 79 80 80 static JSValue* lengthGetter(ExecState*, const Identifier&, const PropertySlot&);81 static JSValue* indexGetter(ExecState*, const Identifier&, const PropertySlot&);82 static JSValue* indexNumericPropertyGetter(ExecState*, unsigned, const PropertySlot&);83 84 81 UString m_value; 85 82 }; … … 96 93 { 97 94 if (propertyName == exec->propertyNames().length) { 98 slot.set Custom(this, lengthGetter);95 slot.setValue(jsNumber(exec, value().size())); 99 96 return true; 100 97 } … … 103 100 unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 104 101 if (isStrictUInt32 && i < static_cast<unsigned>(m_value.size())) { 105 slot.set CustomIndex(this, i, indexGetter);102 slot.setValue(jsString(exec, value().substr(i, 1))); 106 103 return true; 107 104 } … … 110 107 } 111 108 112 ALWAYS_INLINE bool JSString::getStringPropertySlot( unsigned propertyName, PropertySlot& slot)109 ALWAYS_INLINE bool JSString::getStringPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 113 110 { 114 111 if (propertyName < static_cast<unsigned>(m_value.size())) { 115 slot.set CustomNumeric(this, indexNumericPropertyGetter);112 slot.setValue(jsString(exec, value().substr(propertyName, 1))); 116 113 return true; 117 114 }
