OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 longstring = longstring + longstring; | 171 longstring = longstring + longstring; |
172 longstring = longstring + longstring; | 172 longstring = longstring + longstring; |
173 longstring = longstring + longstring; | 173 longstring = longstring + longstring; |
174 longstring = longstring + longstring; | 174 longstring = longstring + longstring; |
175 longstring = longstring + longstring; | 175 longstring = longstring + longstring; |
176 longstring = longstring + longstring; | 176 longstring = longstring + longstring; |
177 longstring = longstring + longstring; | 177 longstring = longstring + longstring; |
178 longstring = longstring + longstring; | 178 longstring = longstring + longstring; |
179 // longstring.length == 5 << 11 | 179 // longstring.length == 5 << 11 |
180 | 180 |
181 replaceTest(longstring + longstring, | 181 replaceTest(longstring + longstring, |
182 "<" + longstring + ">", /<(.*)>/g, "$1$1"); | 182 "<" + longstring + ">", /<(.*)>/g, "$1$1"); |
183 | 183 |
184 replaceTest("string 42", "string x", /x/g, function() { return 42; }); | 184 replaceTest("string 42", "string x", /x/g, function() { return 42; }); |
185 replaceTest("string 42", "string x", /x/, function() { return 42; });
| 185 replaceTest("string 42", "string x", /x/, function() { return 42; }); |
186 replaceTest("string 42", "string x", /[xy]/g, function() { return 42; }); | 186 replaceTest("string 42", "string x", /[xy]/g, function() { return 42; }); |
187 replaceTest("string 42", "string x", /[xy]/, function() { return 42; }); | 187 replaceTest("string 42", "string x", /[xy]/, function() { return 42; }); |
188 replaceTest("string true", "string x", /x/g, function() { return true; }); | 188 replaceTest("string true", "string x", /x/g, function() { return true; }); |
189 replaceTest("string null", "string x", /x/g, function() { return null; }); | 189 replaceTest("string null", "string x", /x/g, function() { return null; }); |
190 replaceTest("string undefined", "string x", /x/g, function() { return undefined;
}); | 190 replaceTest("string undefined", "string x", /x/g, function() { return undefined;
}); |
| 191 |
| 192 replaceTest("aundefinedbundefinedcundefined", |
| 193 "abc", /(.)|(.)/g, function(m, m1, m2, i, s) { return m1+m2; }); |
OLD | NEW |