Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
{{deps.edn}}:


{:deps {org.clojure/clojurescript
        {:git/url "https://github.com/clojure/clojurescript"
         :sha "435af1a9ee69e225676fe743556d60efff5bde37"}}}


Node and Nashorn have the desired shutdown-blocking property, but not Browser:


$ clj -m cljs.main -re nashorn -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
#object[Object]
:goodbye
:hi
$ clj -m cljs.main -re node -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
#object[Timeout [object Object]]
:goodbye
:hi
$ clj -m cljs.main -re browser -e '(js/setTimeout #(prn :hi) 1000)' -e ':goodbye'
Compiling client js ...
Serving HTTP on localhost port 9000
Listening for browser REPL connect ...
13
:goodbye


This would be useful for running asynchronous tests, like those in {{core.async}}.

2 Answers

0 votes
by

Comment made by: dnolen

I don't know that there's anyway to make this work? We don't control the browser process the way the other REPLs control the JS runtime.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-2574 (reported by mfikes)
...