js-on-sx: object literal __proto__ + try/catch error wrapping
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 36s

This commit is contained in:
2026-05-08 22:13:17 +00:00
parent 0d9c45176b
commit a1030dce5d
3 changed files with 58 additions and 2 deletions

View File

@@ -1407,7 +1407,28 @@
(let
((body-tr (js-transpile body)))
(let
((with-catch (cond ((= catch-part nil) body-tr) (else (let ((pname (nth catch-part 0)) (cbody (nth catch-part 1))) (list (js-sym "guard") (list (if (= pname nil) (js-sym "__exc__") (js-sym pname)) (list (js-sym "else") (js-transpile cbody))) body-tr))))))
((with-catch
(cond
((= catch-part nil) body-tr)
(else
(let
((pname (nth catch-part 0))
(cbody (nth catch-part 1))
(raw-sym (js-sym "__raw_exc__")))
(list
(js-sym "guard")
(list
raw-sym
(list
(js-sym "else")
(cond
((= pname nil) (js-transpile cbody))
(else
(list
(js-sym "let")
(list (list (js-sym pname) (list (js-sym "js-wrap-exn") raw-sym)))
(js-transpile cbody))))))
body-tr))))))
(cond
((= finally-part nil) with-catch)
(else