Index: test/mjsunit/regexp-global.js |
diff --git a/test/mjsunit/regexp-global.js b/test/mjsunit/regexp-global.js |
index fac5c6af03fd11dfcb3a4527d948c0e56b47315d..4b833d7c6c69a037878e8ae13109e38a69250810 100644 |
--- a/test/mjsunit/regexp-global.js |
+++ b/test/mjsunit/regexp-global.js |
@@ -125,3 +125,8 @@ str = str.replace(/(FOUR|TWO) \u817f (GOOD|BAD)/g, |
return match.length - 7; |
}); |
assertEquals("4, 2!", str); |
+ |
+// Test capture that is a real substring. |
Lasse Reichstein Nielsen
2012/05/29 09:06:52
Description isn't very descriptive :)
You are test
Lasse Reichstein Nielsen
2012/05/29 10:41:28
Actually, you are testing a capture that *isn't* a
|
+var str = "Beasts of England, beasts of Ireland"; |
+str = str.replace(/(.*)/g, function(match) { return '~'; }); |
+assertEquals("~~"); |
Lasse Reichstein Nielsen
2012/05/29 09:06:52
Shouldn't there be a second argument here, probabl
Lasse Reichstein Nielsen
2012/05/29 10:41:28
My bad, you already fixed that.
|