GetById list caching should use something object-oriented rather than PolymorphicAcce...
[WebKit-https.git] / Source / JavaScriptCore / tests / stress / prototype-getter.js
1 function Foo(g) {
2     this.g_ = g;
3 }
4 Foo.prototype.__defineGetter__("f", function() { return this.g_ + 32; });
5 Foo.prototype.__defineGetter__("g", function() { return this.g_ + 33; });
6 Foo.prototype.__defineGetter__("h", function() { return this.g_ + 34; });
7 Foo.prototype.__defineGetter__("i", function() { return this.g_ + 35; });
8 Foo.prototype.__defineGetter__("j", function() { return this.g_ + 36; });
9 Foo.prototype.__defineGetter__("k", function() { return this.g_ + 37; });
10
11 function foo(o) {
12     return o.f + o.k * 1000;
13 }
14
15 noInline(foo);
16
17 for (var i = 0; i < 100; ++i) {
18     var result = foo(new Foo(5));
19     if (result != (32 + 5) + (37 + 5) * 1000)
20         throw "Error: bad result: " + result;
21 }