1function Foo() { 2} 3Foo.prototype.f = 42; 4Foo.prototype.g = 43; 5Foo.prototype.h = 44; 6Foo.prototype.i = 45; 7Foo.prototype.j = 46; 8Foo.prototype.k = 47; 9 10function Bar() { 11} 12Bar.prototype.k = 23; 13Bar.prototype.f = 24; 14 15function foo(o) { 16 return o.f + o.k; 17} 18 19noInline(foo); 20 21for (var i = 0; i < 100; ++i) { 22 var result = foo(new Foo()); 23 if (result != 89) 24 throw "Error: bad result for Foo: " + result; 25 result = foo(new Bar()); 26 if (result != 47) 27 throw "Error: bad result for Bar: " + result; 28} 29