Reviewers: rossberg,

Description:
Fix RegExp white-space character class to match BOMs.

[email protected]
TEST=test262/S15.10.2.12_A?_T1,mjsunit/regexp


Please review this at https://chromiumcodereview.appspot.com/9426032/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/jsregexp.cc
  M test/mjsunit/regexp.js
  M test/sputnik/sputnik.status
  M test/test262/test262.status


Index: src/jsregexp.cc
diff --git a/src/jsregexp.cc b/src/jsregexp.cc
index 18b86bafee962619c8928196da419b47b7a3e480..bb816b76ad614a512f7ab5ad9df599f60349b990 100644
--- a/src/jsregexp.cc
+++ b/src/jsregexp.cc
@@ -3597,11 +3597,11 @@ void RegExpEngine::DotPrint(const char* label,
 // -------------------------------------------------------------------
 // Tree to graph conversion

-static const int kSpaceRangeCount = 20;
-static const int kSpaceRangeAsciiCount = 4;
+static const int kSpaceRangeCount = 22;
static const uc16 kSpaceRanges[kSpaceRangeCount] = { 0x0009, 0x000D, 0x0020,
     0x0020, 0x00A0, 0x00A0, 0x1680, 0x1680, 0x180E, 0x180E, 0x2000, 0x200A,
-    0x2028, 0x2029, 0x202F, 0x202F, 0x205F, 0x205F, 0x3000, 0x3000 };
+    0x2028, 0x2029, 0x202F, 0x202F, 0x205F, 0x205F, 0x3000, 0x3000, 0xFEFF,
+    0xFEFF };

 static const int kWordRangeCount = 8;
 static const uc16 kWordRanges[kWordRangeCount] = { '0', '9', 'A', 'Z', '_',
Index: test/mjsunit/regexp.js
diff --git a/test/mjsunit/regexp.js b/test/mjsunit/regexp.js
index 3c4f883bdc1503dcf0fcd3ac651471279176075a..76fa44be9c064ca7a8283d28c9334e2b51a860e8 100644
--- a/test/mjsunit/regexp.js
+++ b/test/mjsunit/regexp.js
@@ -127,6 +127,17 @@ assertTrue(re.test("$"));

 assertTrue(/^[Z-\c-e]*$/.test("Z[\\cde"));

+// Test that we handle \s and \S correctly on special Unicode characters.
+re = /\s/;
+assertTrue(re.test("\u2028"));
+assertTrue(re.test("\u2029"));
+assertTrue(re.test("\uFEFF"));
+
+re = /\S/;
+assertFalse(re.test("\u2028"));
+assertFalse(re.test("\u2029"));
+assertFalse(re.test("\uFEFF"));
+
 // Test that we handle \s and \S correctly inside some bizarre
 // character classes.
 re = /[\s-:]/;
Index: test/sputnik/sputnik.status
diff --git a/test/sputnik/sputnik.status b/test/sputnik/sputnik.status
index 048e852375c1ad5ec604b87982868701af8202a9..acef258f3942f4295063786c8ad37fabdf449a6b 100644
--- a/test/sputnik/sputnik.status
+++ b/test/sputnik/sputnik.status
@@ -130,6 +130,8 @@ S15.5.4.14_A1_T7: PASS || FAIL_OK
 S15.5.4.14_A1_T8: PASS || FAIL_OK
 S15.5.4.14_A1_T9: PASS || FAIL_OK
 S15.5.4.14_A2_T7: PASS || FAIL_OK
+S15.10.2.12_A1_T1: PASS || FAIL_OK
+S15.10.2.12_A2_T1: PASS || FAIL_OK

 # We allow function declarations within statements
 S12.6.2_A13_T1: FAIL_OK
Index: test/test262/test262.status
diff --git a/test/test262/test262.status b/test/test262/test262.status
index 4ce3ff901cc1de0524beadd0332c99ae5697a49d..db99c80757147cbcea3e63fcef5afcbc430278e4 100644
--- a/test/test262/test262.status
+++ b/test/test262/test262.status
@@ -56,10 +56,6 @@ S10.4.2.1_A1: FAIL
 15.2.3.7-6-a-284: FAIL
 15.2.3.7-6-a-285: FAIL

-# Unanalyzed failures:
-S15.10.2.12_A1_T1: FAIL
-S15.10.2.12_A2_T1: FAIL
-
 ##################### DELIBERATE INCOMPATIBILITIES #####################

 # We deliberately treat arguments to parseInt() with a leading zero as


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to