Changeset 7222 in webkit for trunk/JavaScriptCore/kjs/regexp_object.cpp
- Timestamp:
- Aug 10, 2004, 11:43:51 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/regexp_object.cpp
r7181 r7222 106 106 return Boolean(false); 107 107 else 108 Null();108 return Null(); 109 109 } 110 110 RegExpObjectImp* regExpObj = static_cast<RegExpObjectImp*>(exec->lexicalInterpreter()->builtinRegExp().imp()); … … 203 203 for ( uint i = 1 ; i < lastNrSubPatterns + 1 ; ++i ) 204 204 { 205 UString substring = lastString.substr( lastOvector[2*i], lastOvector[2*i+1] - lastOvector[2*i] ); 206 list.append(String(substring)); 205 int start = lastOvector[2*i]; 206 if (start == -1) 207 list.append(UndefinedImp::staticUndefined); 208 else { 209 UString substring = lastString.substr( start, lastOvector[2*i+1] - start ); 210 list.append(String(substring)); 211 } 207 212 } 208 213 Object arr = exec->lexicalInterpreter()->builtinArray().construct(exec, list); … … 262 267 // TODO: throw a syntax error on invalid flags 263 268 264 dat->putDirect("global", global ? BooleanImp::staticTrue : BooleanImp::staticFalse );265 dat->putDirect("ignoreCase", ignoreCase ? BooleanImp::staticTrue : BooleanImp::staticFalse );266 dat->putDirect("multiline", multiline ? BooleanImp::staticTrue : BooleanImp::staticFalse );267 268 dat->putDirect("source", new StringImp(p) );269 dat->putDirect("global", global ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum); 270 dat->putDirect("ignoreCase", ignoreCase ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum); 271 dat->putDirect("multiline", multiline ? BooleanImp::staticTrue : BooleanImp::staticFalse, DontDelete | ReadOnly | DontEnum); 272 273 dat->putDirect("source", new StringImp(p), DontDelete | ReadOnly | DontEnum); 269 274 dat->putDirect("lastIndex", NumberImp::zero(), DontDelete | DontEnum); 270 275
Note:
See TracChangeset
for help on using the changeset viewer.