| function shouldBe(actual, expected) { |
| throw new Error('bad value: ' + actual); |
| class DerivedArray extends Array { |
| array.__proto__ = DerivedArray.prototype; |
| shouldBe(array.indexOf(42), 2); |
| shouldBe(array.called, true); |
| array.__proto__ = DerivedArray.prototype; |
| shouldBe(array.indexOf(42), 2); |
| shouldBe(array.called, true); |
| array.__proto__ = DerivedArray.prototype; |
| shouldBe(array.indexOf(42), 2); |
| shouldBe(array.called, true); |
| array.__proto__ = DerivedArray.prototype; |
| shouldBe(array.indexOf(42), 2); |
| shouldBe(array.called, true); |
| array.__proto__ = DerivedArray.prototype; |
| ensureArrayStorage(array); |
| shouldBe(array.indexOf(42), 2); |
| shouldBe(array.called, true); |