(thrower, reference, topmost_wasm_func)
| 197 | } |
| 198 | |
| 199 | function CheckStackTrace(thrower, reference, topmost_wasm_func) { |
| 200 | let reference_exception; |
| 201 | let actual_exception; |
| 202 | try { |
| 203 | thrower(); |
| 204 | assertUnreachable(); |
| 205 | } catch (e) { |
| 206 | actual_exception = e; |
| 207 | } |
| 208 | try { |
| 209 | reference(); |
| 210 | assertUnreachable(); |
| 211 | } catch (e) { |
| 212 | reference_exception = e; |
| 213 | } |
| 214 | assertInstanceof(actual_exception, reference_exception.constructor); |
| 215 | let actual_stack = actual_exception.stack.split('\n'); |
| 216 | let reference_stack = reference_exception.stack.split('\n'); |
| 217 | assertEquals(reference_stack[0], actual_stack[0]); |
| 218 | assertEquals(reference_stack[1], actual_stack[1]); |
| 219 | |
| 220 | let str_stack_msg = ` at ${topmost_wasm_func} (wasm://wasm/`; |
| 221 | if (!actual_stack[2].startsWith(str_stack_msg)) { |
| 222 | console.log( |
| 223 | `expected starts with:\n${str_stack_msg}\nfound:\n${actual_stack[2]}`); |
| 224 | assertUnreachable(); |
| 225 | } |
| 226 | } |
| 227 | |
| 228 | function CheckDataViewErrorMessages( |
| 229 | dataview_op, array, detach_check, set_to_value) { |
no test coverage detected