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

msaboff at apple.com msaboff at apple.com
Wed Dec 22 14:26:58 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 475ffb12a4d818df01575c6619c83b2cf1df493b
Author: msaboff at apple.com <msaboff at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 8 21:32:41 2010 +0000

    2010-10-08  Michael Saboff  <msaboff at apple.com>
    
            Reviewed by Darin Adler.
    
            Added check to start of subexpression being positive before using
            subexpression in replacement.
            https://bugs.webkit.org/show_bug.cgi?id=47324
    
            * runtime/StringPrototype.cpp:
            (JSC::substituteBackreferencesSlow):
    2010-10-08  Michael Saboff  <msaboff at apple.com>
    
            Reviewed by Darin Adler.
    
            Added test case to verify subexpression that didn't match is not
            included in replacement.
            https://bugs.webkit.org/show_bug.cgi?id=47324
    
            * fast/js/script-tests/string-replace-3.js:
            * fast/js/string-replace-3-expected.txt:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 1c439aa..7aa1ea2 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-08  Michael Saboff  <msaboff at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Added check to start of subexpression being positive before using
+        subexpression in replacement.
+        https://bugs.webkit.org/show_bug.cgi?id=47324
+
+        * runtime/StringPrototype.cpp:
+        (JSC::substituteBackreferencesSlow):
+
 2010-10-08  Chris Evans  <cevans at google.com>
 
         Reviewed by David Levin.
diff --git a/JavaScriptCore/runtime/StringPrototype.cpp b/JavaScriptCore/runtime/StringPrototype.cpp
index 91e9b06..ceae795 100644
--- a/JavaScriptCore/runtime/StringPrototype.cpp
+++ b/JavaScriptCore/runtime/StringPrototype.cpp
@@ -206,7 +206,8 @@ static NEVER_INLINE UString substituteBackreferencesSlow(const UString& replacem
             substitutedReplacement.append(replacement.characters() + offset, i - offset);
         i += 1 + advance;
         offset = i + 1;
-        substitutedReplacement.append(source.characters() + backrefStart, backrefLength);
+        if (backrefStart >= 0)
+            substitutedReplacement.append(source.characters() + backrefStart, backrefLength);
     } while ((i = replacement.find('$', i + 1)) != notFound);
 
     if (replacement.length() - offset)
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 6fdb125..c3ce498 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-10-08  Michael Saboff  <msaboff at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Added test case to verify subexpression that didn't match is not
+        included in replacement.
+        https://bugs.webkit.org/show_bug.cgi?id=47324
+
+        * fast/js/script-tests/string-replace-3.js:
+        * fast/js/string-replace-3-expected.txt:
+
 2010-10-08  Andrei Popescu  <andreip at google.com>
 
         Reviewed by Jeremy Orlow.
diff --git a/LayoutTests/fast/js/script-tests/string-replace-3.js b/LayoutTests/fast/js/script-tests/string-replace-3.js
index f6cc27a..e191ea5 100644
--- a/LayoutTests/fast/js/script-tests/string-replace-3.js
+++ b/LayoutTests/fast/js/script-tests/string-replace-3.js
@@ -37,4 +37,6 @@ shouldBe("('' + twoChar + twoChar + twoChar).replace('aa', 'b')", "'baaaa'");
 shouldBe("('' + twoChar + twoChar + twoChar).replace('aa', 'bb')", "'bbaaaa'");
 shouldBe("('' + twoChar + twoChar + twoChar).replace('a', 'bb')", "'bbaaaaa'");
 
+shouldBe("'\"'.replace(/([^\\])?([\"'])/g, '$1\\$2')", "'\"'");
+
 var successfullyParsed = true;
diff --git a/LayoutTests/fast/js/string-replace-3-expected.txt b/LayoutTests/fast/js/string-replace-3-expected.txt
index 905b697..6432e6b 100644
--- a/LayoutTests/fast/js/string-replace-3-expected.txt
+++ b/LayoutTests/fast/js/string-replace-3-expected.txt
@@ -19,6 +19,7 @@ PASS ('' + twoChar + twoChar + twoChar).replace('a', 'b') is 'baaaaa'
 PASS ('' + twoChar + twoChar + twoChar).replace('aa', 'b') is 'baaaa'
 PASS ('' + twoChar + twoChar + twoChar).replace('aa', 'bb') is 'bbaaaa'
 PASS ('' + twoChar + twoChar + twoChar).replace('a', 'bb') is 'bbaaaaa'
+PASS '"'.replace(/([^\])?(["'])/g, '$1\$2') is '"'
 PASS successfullyParsed is true
 
 TEST COMPLETE

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list