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

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

Issue 12427: Merge regexp2000 back into bleeding_edge (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
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
Index: test/mjsunit/unicode-test.js
===================================================================
--- test/mjsunit/unicode-test.js (revision 830)
+++ test/mjsunit/unicode-test.js (working copy)
@@ -9134,6 +9134,32 @@
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 + "]");

Powered by Google App Engine
This is Rietveld 408576698