]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/arrayify-fires-watchpoint.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / arrayify-fires-watchpoint.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
15function makeObjectArray(value) {
16 var result = {};
17 result[0] = value;
18 return result;
19}
20
21var p = {f:42};
22p[0] = 5;
23for (var i = 0; i < 100000; ++i) {
24 test(makeObjectArray(4), p, 88);
25 test(makeObjectArray(4.5), p, 88.5);
26}
27
28test(p, p, 89);