| var foos = [new Foo0(), new Foo1(), new Foo2(), new Foo3(), new Foo4(), new Foo5(), new Foo6(), new Foo7(), new Foo8(), new Foo9(), new Foo10(), new Foo11(), new Foo12(), new Foo13(), new Foo14(), new Foo15(), new Foo16(), new Foo17(), new Foo18(), new Foo19(), new Foo20(), new Foo21(), new Foo22(), new Foo23(), new Foo24(), new Foo25(), new Foo26(), new Foo27(), new Foo28(), new Foo29(), new Foo30(), new Foo31(), new Foo32(), new Foo33(), new Foo34(), new Foo35(), new Foo36(), new Foo37(), new Foo38(), new Foo39(), new Foo40(), new Foo41(), new Foo42(), new Foo43(), new Foo44(), new Foo45(), new Foo46(), new Foo47(), new Foo48(), new Foo49(), new Foo50(), new Foo51(), new Foo52(), new Foo53(), new Foo54(), new Foo55(), new Foo56(), new Foo57(), new Foo58(), new Foo59(), new Foo60(), new Foo61(), new Foo62(), new Foo63(), new Foo64(), new Foo65(), new Foo66(), new Foo67(), new Foo68(), new Foo69(), new Foo70(), new Foo71(), new Foo72(), new Foo73(), new Foo74(), new Foo75(), new Foo76(), new Foo77(), new Foo78(), new Foo79(), new Foo80(), new Foo81(), new Foo82(), new Foo83(), new Foo84(), new Foo85(), new Foo86(), new Foo87(), new Foo88(), new Foo89(), new Foo90(), new Foo91(), new Foo92(), new Foo93(), new Foo94(), new Foo95(), new Foo96(), new Foo97(), new Foo98(), new Foo99()]; |
| var numberOfGetPrototypeOfCalls = 0; |
| var doBadThings = function() { }; |
| Bar.prototype = new Proxy( |
| numberOfGetPrototypeOfCalls++; |
| // Break some watchpoints. |
| for (var i = 0; i < 5; ++i) |
| var _ = p instanceof Foo; |
| for (var i = 0; i < 10000; ++i) { |
| var result = foo({f:42}, foos[i % foos.length]); |
| throw "Error: bad result in loop: " + result; |
| var didCallGetter = false; |
| doBadThings = function() { |
| globalO.__defineGetter__("f", function() { |
| var result = foo(globalO, new Bar()); |
| throw "Error: bad result at end: " + result; |
| throw "Error: did not call getter"; |
| if (numberOfGetPrototypeOfCalls != 5) |
| throw "Error: did not call getPrototypeOf() the right number of times at end"; |