Upgrade V8 to version 4.9.385.28
https://chromium.googlesource.com/v8/v8/+/4.9.385.28
FPIIM-449
Change-Id: I4b2e74289d4bf3667f2f3dc8aa2e541f63e26eb4
diff --git a/test/mjsunit/string-replace.js b/test/mjsunit/string-replace.js
index de92115..e8392ae 100644
--- a/test/mjsunit/string-replace.js
+++ b/test/mjsunit/string-replace.js
@@ -163,6 +163,30 @@
assertEquals(3, ctr, "replace(/x/g,func) num-match");
+replaceTest("ABCD", "abcd", /(.)/g, function r(m, c1, i, s) {
+ assertEquals("d", RegExp.lastMatch);
+ assertEquals("d", RegExp.$1);
+ assertEquals("abc", RegExp.leftContext);
+ return m.toUpperCase();
+});
+
+
+var long = "";
+while (long.length < 0x2000) {
+ long += String.fromCharCode(65 + Math.random() * 26);
+}
+
+for (var i = 0; i < 3; i++) {
+ replaceTest(long.toLowerCase(), long, /(..)/g, function r(m, c1, i, s) {
+ var expected = long.substring(0x1ffe, 0x2000);
+ assertEquals(expected, RegExp.lastMatch);
+ assertEquals(expected, RegExp.$1);
+ assertEquals(long.substring(0, 0x1ffe), RegExp.leftContext);
+ return m.toLowerCase();
+ });
+}
+
+
// Test special cases of replacement parts longer than 1<<11.
var longstring = "xyzzy";
longstring = longstring + longstring;
@@ -194,20 +218,6 @@
// Test nested calls to replace, including that it sets RegExp.$& correctly.
-function replacer(m,i,s) {
- assertEquals(m,RegExp['$&']);
- return "[" + RegExp['$&'] + "-"
- + m.replace(/./g,"$&$&") + "-"
- + m.replace(/./g,function() { return RegExp['$&']; })
- + "-" + RegExp['$&'] + "]";
-}
-
-replaceTest("[ab-aabb-ab-b][az-aazz-az-z]",
- "abaz", /a./g, replacer);
-
-replaceTest("[ab-aabb-ab-b][az-aazz-az-z]",
- "abaz", /a(.)/g, replacer);
-
var str = 'She sells seashells by the seashore.';
var re = /sh/g;
assertEquals('She sells sea$schells by the sea$schore.',