| var findTypeForExpression = $vm.findTypeForExpression; |
| load("./driver/driver.js"); |
| var Proto = function() {}; |
| for (var i = 0; i < MaxStructureCountWithoutOverflow; i++) { |
| // Make sure we get a new prototype chain on each assignment to x because objects with shared prototype chains will be merged. |
| Proto.prototype.__proto__ = oldProto.prototype; |
| for (var i = 0; i < MaxStructureCountWithoutOverflow - 1; i++) { |
| Proto.prototype.__proto__ = oldProto.prototype; |
| var types = findTypeForExpression(wrapper, "x;"); |
| assert(types.isOverflown, "x should be overflown with too many structure shapes."); |
| var types = findTypeForExpression(wrapper, "y;"); |
| assert(!types.isOverflown, "y should not be overflown with too many structure shapes."); |