| function shouldBe(actual, expected) |
| throw new Error(`bad value: ${String(actual)}`); |
| function shouldThrow(func, errorMessage) |
| throw new Error('not thrown'); |
| if (String(error) !== errorMessage) |
| throw new Error(`bad error: ${String(error)}`); |
| shouldBe(JSON.stringify(new Proxy([undefined], {})), `[null]`); |
| shouldBe(JSON.stringify(new Proxy([function() { }], {})), `[null]`); |
| shouldBe(JSON.stringify(new Proxy({ value: undefined }, {})), `{}`); |
| shouldThrow(function () { |
| let proxy = new Proxy([], { |
| get(theTarget, propName) { |
| if (propName === 'length') |