We're updating the issue view to help you get more done. 

cljs.main: Graceful shutdown for browser REPL if timers in flight

Description

deps.edn:

1 2 3 {: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:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 $ 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.

Environment

None

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Priority

Minor