(thrower, reference, topmost_wasm_func)
| 7 | d8.file.execute('test/mjsunit/wasm/wasm-module-builder.js'); |
| 8 | |
| 9 | function CheckStackTrace(thrower, reference, topmost_wasm_func) { |
| 10 | let reference_exception; |
| 11 | let actual_exception; |
| 12 | try { |
| 13 | thrower(); |
| 14 | assertUnreachable(); |
| 15 | } catch (e) { |
| 16 | actual_exception = e; |
| 17 | } |
| 18 | try { |
| 19 | reference(); |
| 20 | assertUnreachable(); |
| 21 | } catch (e) { |
| 22 | reference_exception = e; |
| 23 | } |
| 24 | assertInstanceof(actual_exception, reference_exception.constructor); |
| 25 | let actual_stack = actual_exception.stack.split('\n'); |
| 26 | let reference_stack = reference_exception.stack.split('\n'); |
| 27 | assertEquals(reference_stack[0], actual_stack[0]); |
| 28 | assertEquals(reference_stack[1], actual_stack[1]); |
| 29 | assertTrue( |
| 30 | actual_stack[2].startsWith(` at ${topmost_wasm_func} (wasm://wasm/`)); |
| 31 | } |
| 32 | |
| 33 | let builder = new WasmModuleBuilder(); |
| 34 | let sig_w_w = makeSig([kWasmStringRef], [kWasmStringRef]); |
no test coverage detected