X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/2d39b0e377c0896910ee49ae70082ba665faf986..ed1e77d3adeb83d26fd1dfb16dd84cabdcefd250:/tests/stress/op-push-name-scope-crashes-profiler.js diff --git a/tests/stress/op-push-name-scope-crashes-profiler.js b/tests/stress/op-push-name-scope-crashes-profiler.js new file mode 100644 index 0000000..42784f1 --- /dev/null +++ b/tests/stress/op-push-name-scope-crashes-profiler.js @@ -0,0 +1,17 @@ +//@ runProfiler +function test() { + (function functionName() { + ++counter; + if (!arguments[0]) + return; + eval("functionName(arguments[0] - 1, functionName, '' + functionName);"); + })(arguments[0]); +} + +for (var i = 0; i < 10000; ++i) { + counter = 0; + test(100); + if (counter !== 101) { + throw "Oops, test(100) = " + test(100) + ", expected 101."; + } +} \ No newline at end of file