]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/liveness-pruning-needed-for-osr-availability-eager.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / liveness-pruning-needed-for-osr-availability-eager.js
diff --git a/tests/stress/liveness-pruning-needed-for-osr-availability-eager.js b/tests/stress/liveness-pruning-needed-for-osr-availability-eager.js
new file mode 100644 (file)
index 0000000..e6078b5
--- /dev/null
@@ -0,0 +1,16 @@
+// Note that this only fails in eager compilation.
+
+function each(ary, func) {
+    if (ary)
+        for (var i = 0; i < ary.length && (!ary[i] ||!func(ary[i], i, ary)); i += 1);
+}
+
+var blah = function () {
+    var func = function() {
+        return (function () { }).apply(Object, arguments);
+    };
+    each([ {}, {} ], func);
+};
+
+for (var i = 0; i < 1000; i++)
+    blah();