| function shouldBe(actual, expected) |
| throw new Error('bad value: ' + actual); |
| function shouldThrow(func, errorMessage) { |
| throw new Error('not thrown'); |
| if (String(error) !== errorMessage) |
| throw new Error(`bad error: ${String(error)}`); |
| return Reflect.getPrototypeOf(object); |
| for (var i = 0; i < 1e3; ++i) |
| shouldBe(target({}), Object.prototype); |
| return Reflect.getPrototypeOf(object); |
| for (var i = 0; i < 1e3; ++i) { |
| shouldThrow(() => target(null), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); |
| shouldThrow(() => target(undefined), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); |
| return Reflect.getPrototypeOf(object); |
| for (var i = 0; i < 1e3; ++i) { |
| shouldThrow(() => target("Cocoa"), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); |
| shouldThrow(() => target(42), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); |
| shouldThrow(() => target(true), `TypeError: Reflect.getPrototypeOf requires the first argument be an object`); |