]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/arrayify-to-structure-contradiction.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / arrayify-to-structure-contradiction.js
diff --git a/tests/stress/arrayify-to-structure-contradiction.js b/tests/stress/arrayify-to-structure-contradiction.js
new file mode 100644 (file)
index 0000000..22c8019
--- /dev/null
@@ -0,0 +1,16 @@
+function foo(array, v, p) {
+    array[0] = 10;
+    if (p)
+        v = "hello";
+    array[0] = v;
+}
+
+noInline(foo);
+
+for (var i = 0; i < 100000; ++i) {
+    var array = [42];
+    foo(array, 43, false);
+    if (array[0] != 43)
+        throw "Error: bad result: " + array;
+}
+