Changeset 47780 in webkit for trunk/JavaScriptCore/runtime/JSString.cpp
- Timestamp:
- Aug 26, 2009, 9:52:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/JSString.cpp
r43506 r47780 104 104 } 105 105 106 bool JSString::getStringPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 107 { 108 if (propertyName == exec->propertyNames().length) { 109 descriptor.setDescriptor(jsNumber(exec, m_value.size()), DontEnum | DontDelete | ReadOnly); 110 return true; 111 } 112 113 bool isStrictUInt32; 114 unsigned i = propertyName.toStrictUInt32(&isStrictUInt32); 115 if (isStrictUInt32 && i < static_cast<unsigned>(m_value.size())) { 116 descriptor.setDescriptor(jsSingleCharacterSubstring(exec, m_value, i), DontDelete | ReadOnly); 117 return true; 118 } 119 120 return false; 121 } 122 123 bool JSString::getOwnPropertyDescriptor(ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor) 124 { 125 if (getStringPropertyDescriptor(exec, propertyName, descriptor)) 126 return true; 127 if (propertyName != exec->propertyNames().underscoreProto) 128 return false; 129 descriptor.setDescriptor(exec->lexicalGlobalObject()->stringPrototype(), DontEnum); 130 return true; 131 } 132 106 133 bool JSString::getOwnPropertySlot(ExecState* exec, unsigned propertyName, PropertySlot& slot) 107 134 {
Note:
See TracChangeset
for help on using the changeset viewer.