]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/op-push-name-scope-crashes-profiler.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / 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 (file)
index 0000000..42784f1
--- /dev/null
@@ -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