Changeset 10076 in webkit for trunk/JavaScriptCore/kjs/regexp_object.cpp
- Timestamp:
- Aug 6, 2005, 11:17:49 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp_object.cpp
r9889 r10076 217 217 } 218 218 219 bool RegExpObjectImp::getOwnProperty(ExecState *exec, const Identifier& p, Value& result) const 220 { 221 UString s = p.ustring(); 219 Value RegExpObjectImp::backrefGetter(ExecState *exec, const Identifier& propertyName, const PropertySlot& slot) 220 { 221 RegExpObjectImp *thisObj = static_cast<RegExpObjectImp *>(slot.slotBase()); 222 unsigned long i = slot.index(); 223 224 if (i < thisObj->lastNrSubPatterns + 1) { 225 int *lastOvector = thisObj->lastOvector; 226 UString substring = thisObj->lastString.substr(lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] ); 227 return String(substring); 228 } 229 230 return String(""); 231 } 232 233 bool RegExpObjectImp::getOwnPropertySlot(ExecState *exec, const Identifier& propertyName, PropertySlot& slot) 234 { 235 UString s = propertyName.ustring(); 222 236 if (s[0] == '$' && lastOvector) 223 237 { … … 226 240 if (ok) 227 241 { 228 if (i < lastNrSubPatterns + 1) 229 { 230 UString substring = lastString.substr( lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] ); 231 result = String(substring); 232 } else 233 result = String(""); 234 242 slot.setCustomIndex(this, i, backrefGetter); 235 243 return true; 236 244 } 237 245 } 238 246 239 return InternalFunctionImp::getOwnProperty (exec, p, result);247 return InternalFunctionImp::getOwnPropertySlot(exec, propertyName, slot); 240 248 } 241 249
Note:
See TracChangeset
for help on using the changeset viewer.