| 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)}`); |
| object.Matcha = 'Matcha'; |
| shouldBe(object.Matcha, 'Matcha'); |
| shouldBe(object.Matcha, 'Matcha'); |
| shouldBe(Reflect.isExtensible(object), false); |
| shouldThrow(() => object.Mocha = 'Mocha', `TypeError: Attempted to assign to readonly property.`); |
| object.Matcha = 'Matcha'; |
| shouldBe(object.Matcha, 'Matcha'); |
| shouldBe(object.Matcha, 'Matcha'); |
| shouldBe(Reflect.isExtensible(object), false); |
| shouldThrow(() => object.Mocha = 'Mocha', `TypeError: Attempted to assign to readonly property.`); |