(binding, errorMessage, errorType)
| 7 | }); |
| 8 | |
| 9 | function canThrow (binding, errorMessage, errorType) { |
| 10 | try { |
| 11 | binding.errorHandlingPrim(() => { |
| 12 | throw errorMessage; |
| 13 | }); |
| 14 | } catch (e) { |
| 15 | // eslint-disable-next-line valid-typeof |
| 16 | assert(typeof e === errorType); |
| 17 | assert(e === errorMessage); |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | function test (binding) { |
| 22 | canThrow(binding, '404 server not found!', 'string'); |