Changeset 65840 in webkit
- Timestamp:
- Aug 23, 2010 4:12:46 PM (14 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r65834 r65840 1 2010-08-23 Michael Saboff <msaboff@apple.com> 2 3 Reviewed by Oliver Hunt. 4 5 Fixed case where a single character search string in a string.replace() 6 did not properly handle back reference replacement. The fix is to 7 check for a '$' as part of the check to see if we can execute the 8 single character replace optimization. 9 https://bugs.webkit.org/show_bug.cgi?id=44067 10 11 * runtime/StringPrototype.cpp: 12 (JSC::stringProtoFuncReplace): 13 1 14 2010-08-23 Oliver Hunt <oliver@apple.com> 2 15 -
trunk/JavaScriptCore/runtime/StringPrototype.cpp
r65593 r65840 426 426 427 427 UString patternString = pattern.toString(exec); 428 if (patternString.length() == 1 && callType == CallTypeNone) 428 // Special case for single character patterns without back reference replacement 429 if (patternString.length() == 1 && callType == CallTypeNone && replacementString.find('$', 0) == notFound) 429 430 return JSValue::encode(sourceVal->replaceCharacter(exec, patternString[0], replacementString)); 430 431 431 432 const UString& source = sourceVal->value(exec); 432 433 size_t matchPos = source.find(patternString);
Note: See TracChangeset
for help on using the changeset viewer.