| // Require lots of arguments so that arity fixup will need a lot of stack, making |
| // it prone to stack overflow. |
| var script = "recursionCount, "; |
| for (var i = 0; i < 5000; ++i) |
| var g = new Function(script, "return recursionCount ? g(recursionCount - 1) : 0;"); // Ensure that arguments are observed. |
| // Ensure that f and g get optimized. |
| for (var i = 0; i < 10000; ++i) { |
| // Recurse once to ensure profiling along all control flow paths. |
| // Recurse enough times to trigger a stack overflow exception. |
| if (! (e instanceof RangeError)) |