[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 12:26:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 1b4173b6615d8f4a2e77f58a62217f33d477891f
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Aug 23 23:12:46 2010 +0000

    2010-08-23  Michael Saboff  <msaboff at apple.com>
    
            Reviewed by Oliver Hunt.
    
            Fixed case where a single character search string in a string.replace()
            did not properly handle back reference replacement.  The fix is to
            check for a '$' as part of the check to see if we can execute the
            single character replace optimization.
            https://bugs.webkit.org/show_bug.cgi?id=44067
    
            * runtime/StringPrototype.cpp:
            (JSC::stringProtoFuncReplace):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65840 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index c9a2f14..80e9dac 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-23  Michael Saboff  <msaboff at apple.com>
+
+        Reviewed by Oliver Hunt.
+
+        Fixed case where a single character search string in a string.replace()
+        did not properly handle back reference replacement.  The fix is to 
+        check for a '$' as part of the check to see if we can execute the
+        single character replace optimization.
+        https://bugs.webkit.org/show_bug.cgi?id=44067
+
+        * runtime/StringPrototype.cpp:
+        (JSC::stringProtoFuncReplace):
+
 2010-08-23  Oliver Hunt  <oliver at apple.com>
 
         Reviewed by Gavin Barraclough.
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index cfbb3be..91e9b06 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -425,9 +425,10 @@ EncodedJSValue JSC_HOST_CALL stringProtoFuncReplace(ExecState* exec)
     // Not a regular expression, so treat the pattern as a string.
 
     UString patternString = pattern.toString(exec);
-    if (patternString.length() == 1 && callType == CallTypeNone)
+    // Special case for single character patterns without back reference replacement
+    if (patternString.length() == 1 && callType == CallTypeNone && replacementString.find('$', 0) == notFound)
         return JSValue::encode(sourceVal->replaceCharacter(exec, patternString[0], replacementString));
-    
+
     const UString& source = sourceVal->value(exec);
     size_t matchPos = source.find(patternString);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list