| // This is a simple speed test. It should go fast. |
| for (var i = 0; i < 10000000; ++i) { |
| someGlobal = myObject.undefinedProperty; |
| throw new Error("Bad result: " + result); |
| // This test checks that a cached property lookup miss doesn't continue to fire when the property suddenly appears on the object. |
| for (var i = 0; i < 100000000; ++i) { |
| someGlobal = myObject.someProperty; |
| myObject.someProperty = 1; |
| throw new Error("Bad result: " + result); |
| // This test checks that a cached property lookup miss doesn't continue to fire when the property suddenly appears on the object's prototype. |
| myObject.__proto__ = myPrototype; |
| for (var i = 0; i < 100000000; ++i) { |
| someGlobal = myObject.someProperty; |
| myPrototype.someProperty = 2; |
| throw new Error("Bad result: " + result); |