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

Unified Diff: test/mjsunit/string-replace.js

Issue 1565004: Fix bug in string replace with nonparticipating captures. (Closed)
Patch Set: Untabified. Created 10 years, 9 months 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
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/string-replace.js
diff --git a/test/mjsunit/string-replace.js b/test/mjsunit/string-replace.js
index ea6912724399bd37d99cd1d72ab1a33576f29616..a555c203cc847e4d98edb98c684b6dca91f22c53 100644
--- a/test/mjsunit/string-replace.js
+++ b/test/mjsunit/string-replace.js
@@ -178,13 +178,16 @@ longstring = longstring + longstring;
longstring = longstring + longstring;
// longstring.length == 5 << 11
-replaceTest(longstring + longstring,
+replaceTest(longstring + longstring,
"<" + longstring + ">", /<(.*)>/g, "$1$1");
-
+
replaceTest("string 42", "string x", /x/g, function() { return 42; });
-replaceTest("string 42", "string x", /x/, function() { return 42; });
+replaceTest("string 42", "string x", /x/, function() { return 42; });
replaceTest("string 42", "string x", /[xy]/g, function() { return 42; });
replaceTest("string 42", "string x", /[xy]/, function() { return 42; });
replaceTest("string true", "string x", /x/g, function() { return true; });
replaceTest("string null", "string x", /x/g, function() { return null; });
-replaceTest("string undefined", "string x", /x/g, function() { return undefined; });
+replaceTest("string undefined", "string x", /x/g, function() { return undefined; });
+
+replaceTest("aundefinedbundefinedcundefined",
+ "abc", /(.)|(.)/g, function(m, m1, m2, i, s) { return m1+m2; });
« no previous file with comments | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698