]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/arrayify-structure-bad-test.js
JavaScriptCore-7600.1.4.9.tar.gz
[apple/javascriptcore.git] / tests / stress / arrayify-structure-bad-test.js
CommitLineData
81345200
A
1function foo(a, b) {
2 var x = b.f;
3 x += a[0];
4 return x + b.f;
5}
6
7noInline(foo);
8
9function test(a, b, c) {
10 var result = foo(a, b);
11 if (result != c)
12 throw new Error("bad result: expected " + c + " but got: " + result);
13}
14
15var p = {f:42};
16p[0] = 5;
17for (var i = 0; i < 100000; ++i) {
18 test([4], p, 88);
19 test([4.5], p, 88.5);
20}
21
22test(p, p, 89);