Index: test/webkit/fast/regex/overflow.js |
diff --git a/test/webkit/legitimately-captured-argument.js b/test/webkit/fast/regex/overflow.js |
similarity index 73% |
copy from test/webkit/legitimately-captured-argument.js |
copy to test/webkit/fast/regex/overflow.js |
index a7290e5e1b0005710172a419d08f0f3f2500fdd5..825cd1d96366f57aec3c22f8ef662d41861b46e4 100644 |
--- a/test/webkit/legitimately-captured-argument.js |
+++ b/test/webkit/fast/regex/overflow.js |
@@ -21,18 +21,16 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-description( |
-"Tests that using an argument as a captured variable, in the legitimate sense rather than the function.arguments sense, works as expected." |
-); |
+description("This test checks expressions with alternative lengths of appox. 2^31."); |
-function makeCounter(x) { |
- return function() { |
- return ++x; |
- }; |
-} |
+var regexp1 = /(?:(?=g))|(?:m).{2147483648,}/; |
+shouldBe("regexp1.exec('')", 'null'); |
-for (var i = 0; i < 100; ++i) { |
- var counter = makeCounter(i); |
- for (var j = 0; j < 10; ++j) |
- shouldBe("counter()", "" + (i + j + 1)); |
-} |
+var regexp2 = /(?:(?=g)).{2147483648,}/; |
+shouldBe("regexp2.exec('')", 'null'); |
+ |
+var s3 = "&{6}u4a64YfQP{C}u88c4u5772Qu8693{4294967167}u85f2u7f3fs((uf202){4})u5bc6u1947"; |
+var regexp3 = new RegExp(s3, ""); |
+shouldBe("regexp3.exec(s3)", 'null'); |
+ |
+shouldThrow("function f() { /[^a$]{4294967295}/ }", '"SyntaxError: Invalid regular expression: number too large in {} quantifier"'); |