| 573 | } |
| 574 | |
| 575 | static void tsn_dump_error1(tsn_vm* ctx, tsn_value_const exception_val) { |
| 576 | tsn_value val; |
| 577 | bool is_error; |
| 578 | |
| 579 | is_error = JS_IsError(ctx, exception_val) != 0; |
| 580 | tsn_dump_obj(ctx, stderr, exception_val); |
| 581 | if (is_error) { |
| 582 | val = JS_GetPropertyStr(ctx, exception_val, "stack"); |
| 583 | if (JS_IsUndefined(val) == 0) { |
| 584 | tsn_dump_obj(ctx, stderr, val); |
| 585 | } |
| 586 | JS_FreeValue(ctx, val); |
| 587 | } |
| 588 | } |
| 589 | |
| 590 | bool tsn_has_exception(tsn_vm* ctx) { |
| 591 | return JS_HasException_tsn(ctx) != 0; |
no test coverage detected