(bytes, pos, message)
| 9 | d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); |
| 10 | |
| 11 | function testErrorPosition(bytes, pos, message) { |
| 12 | const buffer = bytes.trunc_buffer(); |
| 13 | // First check the non-streaming decoder as a reference. |
| 14 | const regexp = new RegExp(message + '.*@\\+' + pos); |
| 15 | assertThrows( |
| 16 | () => new WebAssembly.Module(buffer), WebAssembly.CompileError, regexp); |
| 17 | // Next test the actual streaming decoder. |
| 18 | assertThrowsAsync( |
| 19 | WebAssembly.compile(buffer), WebAssembly.CompileError, regexp); |
| 20 | } |
| 21 | |
| 22 | (function testInvalidMagic() { |
| 23 | let bytes = new Binary; |
no test coverage detected