HS: js-block return values + worker stub test
Parser: parse-js-block extracts raw JS source by character positions. Compiler: js-block AST → hs-js-exec call, stores result in it. Runtime: hs-js-exec creates JS Function, handles promise rejection. Test runner: host-new-function/host-promise-state natives + promise monkey-patch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -13636,5 +13636,12 @@ end")
|
||||
;; ── worker (1 tests) ──
|
||||
(defsuite "hs-upstream-worker"
|
||||
(deftest "raises a helpful error when the worker plugin is not installed"
|
||||
(error "SKIP (untranslated): raises a helpful error when the worker plugin is not installed"))
|
||||
(hs-cleanup!)
|
||||
(let ((caught nil))
|
||||
(guard (_e (true (set! caught (str _e))))
|
||||
(hs-compile "worker MyWorker def noop() end end"))
|
||||
(assert (not (nil? caught)))
|
||||
(assert (string-contains? caught "worker plugin"))
|
||||
(assert (string-contains? caught "hyperscript.org/features/worker")))
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user