]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/create-this-with-callee-variants.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / create-this-with-callee-variants.js
diff --git a/tests/stress/create-this-with-callee-variants.js b/tests/stress/create-this-with-callee-variants.js
new file mode 100644 (file)
index 0000000..a7368ae
--- /dev/null
@@ -0,0 +1,18 @@
+function createInLoop(x, count) {
+    noInline(x)
+    for (var i = 0; i < 5000; i++) {
+        var obj = new x;
+        if (!(obj instanceof x))
+            throw "Failed to instantiate the right object";
+    }
+}
+
+function y() { return function () {} }
+
+createInLoop(y());
+
+function z() { return function () {} }
+
+createInLoop(z());
+createInLoop(z());
+createInLoop(z());