Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: test/mjsunit/unicode-test.js

Issue 11228: * No failures on our own tests.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/regexp2000/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/regexp-macro-assembler-re2k.h ('K') | « test/mjsunit/regexp.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/unicode-test.js
===================================================================
--- test/mjsunit/unicode-test.js (revision 786)
+++ test/mjsunit/unicode-test.js (working copy)
@@ -9129,11 +9129,38 @@
}
}
re += "]+)";
+ //dump_re(re);
Christian Plesner Hansen 2008/11/18 14:07:41 ?
var char_class = new RegExp(re, "g");
var munged = text.replace(char_class, "foo");
assertEquals(munged_sizes[i - 1], munged.length, "munged size " + i);
}
+
+function hex(x) {
+ x &= 15;
+ if (x < 10) {
+ return String.fromCharCode(x + 48);
+ } else {
+ return String.fromCharCode(x + 97 - 10);
+ }
+}
+
+
+function dump_re(re) {
+ var out = "";
+ for (var i = 0; i < re.length; i++) {
+ var c = re.charCodeAt(i);
+ if (c >= 32 && c <= 126) {
+ out += re[i];
+ } else if (c < 256) {
+ out += "\\x" + hex(c >> 4) + hex(c);
+ } else {
+ out += "\\u" + hex(c >> 12) + hex(c >> 8) + hex(c >> 4) + hex(c);
+ }
+ }
+ print ("re = " + out);
+}
+
var thai_l_thingy = "\u0e44";
var thai_l_regexp = new RegExp(thai_l_thingy);
var thai_l_regexp2 = new RegExp("[" + thai_l_thingy + "]");
« src/regexp-macro-assembler-re2k.h ('K') | « test/mjsunit/regexp.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698