]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/multi-get-by-offset-proto-and-self.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / multi-get-by-offset-proto-and-self.js
CommitLineData
81345200
A
1function foo(o) {
2 return o.f;
3}
4
5noInline(foo);
6
7function Foo() { }
8Foo.prototype.f = 42;
9
10for (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}