When an error occurs during resumed VM execution (after perform/hs-wait), resume_vm now checks the VM's handler_stack. If a handler exists (from a compiled guard form's OP_PUSH_HANDLER), it unwinds frames and jumps to the catch block — exactly like OP_RAISE. This enables try/catch across async perform/resume boundaries. The guard form compiles to OP_PUSH_HANDLER which lives on the vm struct and survives across setTimeout-based async resume. Previously, errors during resume escaped to the JS console as unhandled exceptions. Also restored guard in the test runner (was cek-try which doesn't survive async) and restored error-throwing assertions in run-action. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
4.9 MiB
4.9 MiB