Skip to content

Commit

Permalink
coerce setTimeout result to boolean, fix for CLJS-3274 (running tests…
Browse files Browse the repository at this point in the history
… w/ recent WebKit)
  • Loading branch information
swannodette committed Aug 7, 2020
1 parent ffbdf90 commit 154b19a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/cljs/cljs/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,16 @@
Strings which should be printed." :dynamic true}
*print-fn* nil)

(declare boolean)

(defn ^{:doc "Arranges to have tap functions executed via the supplied f, a
function of no arguments. Returns true if successful, false otherwise." :dynamic true}
*exec-tap-fn*
[f]
(and
(exists? js/setTimeout)
(js/setTimeout f 0)
true))
(exists? js/setTimeout)
;; See CLJS-3274 - workaround for recent WebKit releases
(boolean (js/setTimeout f 0))))

(defonce
^{:doc "Each runtime environment provides a different way to print error output.
Expand Down

0 comments on commit 154b19a

Please sign in to comment.