]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/multi-get-by-offset-proto-and-self.js
e4510b3f1ef60262810b2a5d48bbfd7fae14cdff
[apple/javascriptcore.git] / tests / stress / multi-get-by-offset-proto-and-self.js
1 function foo(o) {
2 return o.f;
3 }
4
5 noInline(foo);
6
7 function Foo() { }
8 Foo.prototype.f = 42;
9
10 for (var i = 0; i < 100000; ++i) {
11 if (i & 1) {
12 var result = foo(new Foo());
13 if (result != 42)
14 throw "Error: bad result for new Foo(): " + result;
15 } else {
16 var result = foo({f:24});
17 if (result != 24)
18 throw "Error: bad result for {f:24}: " + result;
19 }
20 }