| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| description("This test how deep we can recurse, and that we get an exception when we do, as opposed to a stack overflow."); |
| function simpleRecursion(depth) { |
| simpleRecursion(depth - 1); |
| simpleRecursion(10000000); |
| var msg = String(eval(ex)); |
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); |
| simpleRecursion(1000000000); |
| var msg = String(eval(ex)); |
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); |
| function tooFewArgsRecursion(a) { |
| tooFewArgsDepth = 10000000; |
| var msg = String(eval(ex)); |
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); |
| function tooManyArgsRecursion(depth) { |
| tooManyArgsRecursion(depth - 1, 1); |
| tooManyArgsRecursion(10000000, 1); |
| var msg = String(eval(ex)); |
| shouldBe("msg", "'RangeError: Maximum call stack size exceeded.'"); |
| <script src="../../resources/js-test-post.js"></script> |