JavaScriptCore:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2007 21:25:59 +0000 (21:25 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2007 21:25:59 +0000 (21:25 +0000)
        Reviewed by Mark Rowe.

        - fix http://bugs.webkit.org/show_bug.cgi?id=15543
          <rdar://problem/5545639> REGRESSION (r26697):
          GoogleDocs: Can't create new documents or open existing ones

        Test: fast/js/regexp-non-character.html

        * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
        in the \u sequences -- not needed and actively harmful.

LayoutTests:

        Reviewed by Mark Rowe.

        - test for http://bugs.webkit.org/show_bug.cgi?id=15543
          <rdar://problem/5545639> REGRESSION (r26697):
          GoogleDocs: Can't create new documents or open existing ones

        * fast/js/regexp-non-character-expected.txt: Added.
        * fast/js/regexp-non-character.html: Added.
        * fast/js/resources/regexp-non-character.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@26720 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/pcre/pcre_compile.c
LayoutTests/ChangeLog
LayoutTests/fast/js/regexp-non-character-expected.txt [new file with mode: 0644]
LayoutTests/fast/js/regexp-non-character.html [new file with mode: 0644]
LayoutTests/fast/js/resources/regexp-non-character.js [new file with mode: 0644]

index 3a3e2ceca66d04eb765e6525f88c988220266f0e..fd6708191a369a7f4b5691b5dff8d9a7e4662afb 100644 (file)
@@ -1,3 +1,16 @@
+2007-10-17  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=15543
+          <rdar://problem/5545639> REGRESSION (r26697):
+          GoogleDocs: Can't create new documents or open existing ones
+
+        Test: fast/js/regexp-non-character.html
+
+        * pcre/pcre_compile.c: (check_escape): Take out the checks for valid characters
+        in the \u sequences -- not needed and actively harmful.
+
 2007-10-17  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Oliver.
index 6efcdbb011b971d306c2a28095f7909164c6eca5..e4de226018e06b623bb015afd28ae9de0217883e 100644 (file)
@@ -578,11 +578,6 @@ else
       if (cc >= 'a') cc -= 32;              /* Convert to upper case */
       c = c * 16 + cc - ((cc < 'A')? '0' : ('A' - 10));
       }
-    if (c >= 0xD800 && c <= 0xDFFF) *errorcodeptr = ERR34; // half of surrogate pair
-    else if (c >= 0xFDD0 && c <= 0xFDEF) *errorcodeptr = ERR34; // ?
-    else if (c == 0xFFFE) *errorcodeptr = ERR34; // not a character
-    else if (c == 0xFFFF)  *errorcodeptr = ERR34; // not a character
-    else if (c > 0x10FFFF) *errorcodeptr = ERR34; // out of Unicode character range
     break;
 #endif
 
index 2acfdc694581eff43385303469727e50e07ab84b..127ecd380607a444da524061614c1ea0d76ea54e 100644 (file)
@@ -1,3 +1,15 @@
+2007-10-17  Darin Adler  <darin@apple.com>
+
+        Reviewed by Mark Rowe.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=15543
+          <rdar://problem/5545639> REGRESSION (r26697):
+          GoogleDocs: Can't create new documents or open existing ones
+
+        * fast/js/regexp-non-character-expected.txt: Added.
+        * fast/js/regexp-non-character.html: Added.
+        * fast/js/resources/regexp-non-character.js: Added.
+
 2007-10-17  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Harrison.
diff --git a/LayoutTests/fast/js/regexp-non-character-expected.txt b/LayoutTests/fast/js/regexp-non-character-expected.txt
new file mode 100644 (file)
index 0000000..8dffeaa
--- /dev/null
@@ -0,0 +1,23 @@
+Test for regular expressions with non-character values in them, specifically in character classes.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS "F".match(/[\uD7FF]/) is null
+PASS "0".match(/[\uD800]/) is null
+PASS "F".match(/[\uDFFF]/) is null
+PASS "E".match(/[\uE000]/) is null
+PASS "y".match(/[\uFDBF]/) is null
+PASS "y".match(/[\uFDD0]/) is null
+PASS "y".match(/[\uFDEF]/) is null
+PASS "y".match(/[\uFDF0]/) is null
+PASS "y".match(/[\uFEFF]/) is null
+PASS "y".match(/[\uFEFF]/) is null
+PASS "y".match(/[\uFFFE]/) is null
+PASS "y".match(/[\uFFFF]/) is null
+PASS "y".match(/[\u10FFFF]/) is null
+PASS "y".match(/[\u110000]/) is null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/js/regexp-non-character.html b/LayoutTests/fast/js/regexp-non-character.html
new file mode 100644 (file)
index 0000000..deb51fb
--- /dev/null
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href="resources/js-test-style.css">
+<script src="resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src="resources/regexp-non-character.js"></script>
+<script src="resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/js/resources/regexp-non-character.js b/LayoutTests/fast/js/resources/regexp-non-character.js
new file mode 100644 (file)
index 0000000..240f26f
--- /dev/null
@@ -0,0 +1,20 @@
+description(
+'Test for regular expressions with non-character values in them, specifically in character classes.'
+);
+
+shouldBe('"F".match(/[\\uD7FF]/)', 'null');
+shouldBe('"0".match(/[\\uD800]/)', 'null');
+shouldBe('"F".match(/[\\uDFFF]/)', 'null');
+shouldBe('"E".match(/[\\uE000]/)', 'null');
+shouldBe('"y".match(/[\\uFDBF]/)', 'null');
+shouldBe('"y".match(/[\\uFDD0]/)', 'null');
+shouldBe('"y".match(/[\\uFDEF]/)', 'null');
+shouldBe('"y".match(/[\\uFDF0]/)', 'null');
+shouldBe('"y".match(/[\\uFEFF]/)', 'null');
+shouldBe('"y".match(/[\\uFEFF]/)', 'null');
+shouldBe('"y".match(/[\\uFFFE]/)', 'null');
+shouldBe('"y".match(/[\\uFFFF]/)', 'null');
+shouldBe('"y".match(/[\\u10FFFF]/)', 'null');
+shouldBe('"y".match(/[\\u110000]/)', 'null');
+
+var successfullyParsed = true;