Changeset 59355 in webkit for trunk/JavaScriptCore/runtime
- Timestamp:
- May 13, 2010, 2:36:54 AM (15 years ago)
- Location:
- trunk/JavaScriptCore/runtime
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/ArrayPrototype.cpp
r59339 r59355 272 272 if (isJSArray(&exec->globalData(), thisObj)) { 273 273 JSArray* array = asArray(thisObj); 274 for (; k < length; k++) { 275 if (!array->canGetIndex(k)) 276 break; 277 if (k >= 1) { 278 if (separator.isNull()) 279 strBuffer.append(','); 280 else 281 strBuffer.append(separator); 282 } 274 275 if (length) { 276 if (!array->canGetIndex(k)) 277 goto skipFirstLoop; 283 278 JSValue element = array->getIndex(k); 284 279 if (!element.isUndefinedOrNull()) 285 280 strBuffer.append(element.toString(exec)); 286 } 287 } 281 k++; 282 } 283 284 if (separator.isNull()) { 285 for (; k < length; k++) { 286 if (!array->canGetIndex(k)) 287 break; 288 strBuffer.append(','); 289 JSValue element = array->getIndex(k); 290 if (!element.isUndefinedOrNull()) 291 strBuffer.append(element.toString(exec)); 292 } 293 } else { 294 for (; k < length; k++) { 295 if (!array->canGetIndex(k)) 296 break; 297 strBuffer.append(separator); 298 JSValue element = array->getIndex(k); 299 if (!element.isUndefinedOrNull()) 300 strBuffer.append(element.toString(exec)); 301 } 302 } 303 } 304 skipFirstLoop: 288 305 for (; k < length; k++) { 289 306 if (k >= 1) { -
trunk/JavaScriptCore/runtime/RegExp.cpp
r55322 r59355 108 108 startOffset = 0; 109 109 if (ovector) 110 ovector-> clear();110 ovector->resize(0); 111 111 112 112 if (static_cast<unsigned>(startOffset) > s.size() || s.isNull()) … … 132 132 for (int j = 0; j < offsetVectorSize; ++j) 133 133 offsetVector[j] = -1; 134 135 134 136 135 #if ENABLE(YARR_JIT) -
trunk/JavaScriptCore/runtime/RegExpConstructor.h
r54022 r59355 110 110 e.g., RegExp.lastMatch and RegExp.leftParen. 111 111 */ 112 inlinevoid RegExpConstructor::performMatch(RegExp* r, const UString& s, int startOffset, int& position, int& length, int** ovector)112 ALWAYS_INLINE void RegExpConstructor::performMatch(RegExp* r, const UString& s, int startOffset, int& position, int& length, int** ovector) 113 113 { 114 114 position = r->match(s, startOffset, &d->tempOvector()); -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r59282 r59355 246 246 }; 247 247 248 JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount); 249 JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount) 248 static ALWAYS_INLINE JSValue jsSpliceSubstringsWithSeparators(ExecState* exec, JSString* sourceVal, const UString& source, const StringRange* substringRanges, int rangeCount, const UString* separators, int separatorCount) 250 249 { 251 250 if (rangeCount == 1 && separatorCount == 0) { … … 755 754 756 755 double start = a0.toNumber(exec); 757 double end = a1.toNumber(exec);758 if ( isnan(start))756 double end; 757 if (!(start >= 0)) // check for negative values or NaN 759 758 start = 0; 760 if (isnan(end)) 761 end = 0; 762 if (start < 0) 763 start = 0; 764 if (end < 0) 765 end = 0; 766 if (start > len) 759 else if (start > len) 767 760 start = len; 768 if (end > len)769 end = len;770 761 if (a1.isUndefined()) 771 762 end = len; 763 else { 764 end = a1.toNumber(exec); 765 if (!(end >= 0)) // check for negative values or NaN 766 end = 0; 767 else if (end > len) 768 end = len; 769 } 772 770 if (start > end) { 773 771 double temp = end;
Note:
See TracChangeset
for help on using the changeset viewer.