]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/inline-varargs-get-arguments.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / inline-varargs-get-arguments.js
diff --git a/tests/stress/inline-varargs-get-arguments.js b/tests/stress/inline-varargs-get-arguments.js
new file mode 100644 (file)
index 0000000..041dd69
--- /dev/null
@@ -0,0 +1,23 @@
+function foo(f, array) {
+    return f.apply(this, array);
+}
+
+function bar(a, b, c) {
+    return baz();
+}
+
+function baz() {
+    return bar.arguments[3];
+}
+
+noInline(foo);
+noInline(baz);
+
+var array = [0, 0, 0, 42];
+
+for (var i = 0; i < 10000; ++i) {
+    var result = foo(bar, array);
+    if (result != 42)
+        throw "Error: bad result: " + result;
+}
+