HS: asyncError — rejected promise triggers catch block (+1 test)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 48s
Three-part fix for hs-upstream-core/asyncError test 2/2:
1. runtime.sx hs-win-call: when an async call returns a rejected promise,
store the error value in window.__hs_async_error (side-channel) and
raise the sentinel "__hs_async_error__" so the value survives the
raise boundary intact.
2. compiler.sx catch clause: inject `(let ((var (host-hs-normalize-exc var))) ...)`
around the catch body so the sentinel gets swapped for the real error
object before user code runs. Uses let (not set!) so shadowing works
correctly for guard catch variables.
3. tests/hs-run-filtered.js:
- host-promise-state wraps JS Error objects as plain {message:...} dicts
before they cross the WASM boundary (Error.toString() was producing
"Error: boom" strings instead of accessible objects)
- host-hs-normalize-exc native retrieves the side-channel value when
the sentinel arrives in a catch variable
- host-get coercion restricted to El instances — plain JS objects with
a "value" key were being stringified to "[object Object]"
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -141,7 +141,7 @@ MANUAL_TEST_BODIES = {
|
||||
],
|
||||
"converts multiple selects with programmatically changed selections": [
|
||||
' (let ((_node (dom-create-element "form")))',
|
||||
' (dom-set-inner-html _node "<select name=\"animal\" multiple> <option value=\"dog\" selected>Doggo</option> <option value=\"cat\">Kitteh</option> <option value=\"raccoon\" selected>Trash Panda</option> <option value=\"possum\">Sleepy Boi</option> </select>")',
|
||||
' (dom-set-inner-html _node "<select name=\\"animal\\" multiple> <option value=\\"dog\\" selected>Doggo</option> <option value=\\"cat\\">Kitteh</option> <option value=\\"raccoon\\" selected>Trash Panda</option> <option value=\\"possum\\">Sleepy Boi</option> </select>")',
|
||||
' (let ((_sel (dom-query _node "select")))',
|
||||
' (let ((_opts (host-get _sel "options")))',
|
||||
' (host-set! (nth _opts 0) "selected" false)',
|
||||
|
||||
Reference in New Issue
Block a user