(error, bytes, imports = {}, msg)
| 20 | } |
| 21 | |
| 22 | function assertInstantiateError(error, bytes, imports = {}, msg) { |
| 23 | assertThrows( |
| 24 | () => new WebAssembly.Instance(new WebAssembly.Module(bytes), imports), |
| 25 | error, 'WebAssembly.Instance(): ' + msg); |
| 26 | assertThrowsAsync( |
| 27 | WebAssembly.instantiate(bytes, imports), error, |
| 28 | 'WebAssembly.instantiate(): ' + msg); |
| 29 | } |
| 30 | |
| 31 | // default imports to {} so we get LinkError by default, thus allowing us to |
| 32 | // distinguish the TypeError we want to catch |
no test coverage detected